Skip to content

Commit

Permalink
Fix crash on quit with nwjs/nw.js#6004: prevent double free of web co…
Browse files Browse the repository at this point in the history
…ntents
  • Loading branch information
rogerwang committed Oct 19, 2018
1 parent 925e95d commit f20193b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chrome/browser/devtools/devtools_window.cc
Expand Up @@ -938,6 +938,10 @@ DevToolsWindow::DevToolsWindow(FrontendType frontend_type,
action_on_load_(DevToolsToggleAction::NoOp()),
intercepted_page_beforeunload_(false),
ready_for_test_(false) {
// shouldn't own the web content in embedded cdt use case #6004
// or it will be double freed on quit
if (headless)
owned_main_web_contents_.release();
// Set up delegate, so we get fully-functional window immediately.
// It will not appear in UI though until |life_stage_ == kLoadCompleted|.
if (!headless) //NWJS#4709: keep delegate to web_view_guest so the
Expand Down

0 comments on commit f20193b

Please sign in to comment.