refactor: clean up Session with CleanedUpAtExit (#24603)

This commit is contained in:
Jeremy Rose 2020-07-20 12:13:33 -07:00 committed by GitHub
parent e5cb22b7f9
commit f0953902db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 11 deletions

View file

@ -942,8 +942,6 @@ gin::Handle<Session> Session::CreateFrom(
// The Sessions should never be garbage collected, since the common pattern is
// to use partition strings, instead of using the Session object directly.
handle->Pin(isolate);
ElectronBrowserMainParts::Get()->RegisterDestructionCallback(
base::BindOnce([](Session* session) { delete session; }, handle.get()));
App::Get()->EmitCustomEvent("session-created",
handle.ToV8().As<v8::Object>());