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

View File

@ -149,8 +149,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() {