Fix heap-use-after-free when shutting down CEF with DevTools remote debugging enabled (issue #1557).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2041 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2015-03-03 18:40:52 +00:00
parent ca0e381681
commit a9191b26d2
1 changed files with 5 additions and 2 deletions

View File

@ -149,8 +149,11 @@ CefDevToolsDelegate::~CefDevToolsDelegate() {
}
void CefDevToolsDelegate::Stop() {
// The call below deletes |this|.
devtools_http_handler_.reset();
// Release the reference before deleting the handler. Deleting the handler
// will delete |this| and no members of |this| should be accessed after that
// call.
content::DevToolsHttpHandler* handler = devtools_http_handler_.release();
delete handler;
}
std::string CefDevToolsDelegate::GetDiscoveryPageHTML() {