Skip to content

Commit

Permalink
Sspeculative fix for a crash in DevToolsTargetRegistry::ContentObserver
Browse files Browse the repository at this point in the history
Bug: 838777
Change-Id: I8a1a049ade70cadfebabc8115471732f15432ac1
Reviewed-on: https://chromium-review.googlesource.com/1058372
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558736}
  • Loading branch information
caseq authored and Commit Bot committed May 15, 2018
1 parent f7274b4 commit 4d21bd9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion content/browser/devtools/devtools_target_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,12 @@ class DevToolsTargetRegistry::ContentsObserver : public ObserverBase,
void WebContentsDestroyed() override {
NOTREACHED() << "DevToolsTarget Registry clients should be destroyed "
"before WebContents";
registry_->UnregisterWebContents(web_contents());
}

~ContentsObserver() override {
registry_->UnregisterWebContents(web_contents());
if (web_contents())
registry_->UnregisterWebContents(web_contents());
}

DevToolsTargetRegistry* registry_;
Expand Down

0 comments on commit 4d21bd9

Please sign in to comment.