Skip to content

Commit

Permalink
fix: no more need to distroy WebContents asyncronously
Browse files Browse the repository at this point in the history
Because app.quit now ensures pending tasks are finished before exiting.
  • Loading branch information
zcbenz committed Dec 12, 2019
1 parent 8609c38 commit 53e9030
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions shell/browser/api/atom_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,9 @@ WebContents::~WebContents() {
// BrowserWindow destroys WebContents asynchronously, manually emit the
// destroyed event here.
WebContentsDestroyed();
} else if (Browser::Get()->is_shutting_down()) {
// Destroy WebContents directly when app is shutting down.
DestroyWebContents(false /* async */);
} else {
// Destroy WebContents asynchronously unless app is shutting down,
// because destroy() might be called inside WebContents's event handler.
// Destroy WebContents asynchronously since destroy() might be called
// inside WebContents's event handler.
DestroyWebContents(!IsGuest() /* async */);
// The WebContentsDestroyed will not be called automatically because we
// destroy the webContents in the next tick. So we have to manually
Expand Down

0 comments on commit 53e9030

Please sign in to comment.