fix: multiple move() calls on the same unique_ptr (#42788)

This commit is contained in:
Charles Kerr 2024-07-08 10:04:35 -05:00 committed by GitHub
parent 27e3273f0a
commit e9db02948e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -343,13 +343,12 @@ void ElectronExtensionsBrowserClient::BroadcastEventToRenderers(
return;
}
auto event = std::make_unique<extensions::Event>(histogram_value, event_name,
args.Clone());
for (auto const& [key, browser_context] :
ElectronBrowserContext::browser_context_map()) {
if (browser_context) {
extensions::EventRouter::Get(browser_context.get())
->BroadcastEvent(std::move(event));
->BroadcastEvent(std::make_unique<extensions::Event>(
histogram_value, event_name, args.Clone()));
}
}
}