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

git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/2272@2042 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2015-03-03 18:41:46 +00:00
parent 05daf76e95
commit 56fd0d61e4

View File

@@ -139,8 +139,11 @@ CefDevToolsDelegate::~CefDevToolsDelegate() {
} }
void CefDevToolsDelegate::Stop() { void CefDevToolsDelegate::Stop() {
// The call below deletes |this|. // Release the reference before deleting the handler. Deleting the handler
devtools_http_handler_.reset(); // 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() { std::string CefDevToolsDelegate::GetDiscoveryPageHTML() {