Fix crashes/assertions when CefBrowserImpl is destroyed on a non-UI thread (issue #694).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@736 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-08-13 16:24:53 +00:00
parent 26a2281486
commit 6ab23a802f
5 changed files with 30 additions and 19 deletions

View File

@@ -771,6 +771,9 @@ void CefBrowserImpl::UIT_DestroyBrowser() {
dev_tools_agent_.reset();
}
if (frame_objects_.size() > 0)
frame_objects_.clear();
// Clean up anything associated with the WebViewHost widget.
if (webviewhost_.get()) {
if (webviewhost_->webwidget())
@@ -778,6 +781,13 @@ void CefBrowserImpl::UIT_DestroyBrowser() {
webviewhost_.reset();
}
delegate_.reset(NULL);
popup_delegate_.reset(NULL);
nav_controller_.reset(NULL);
if (paint_delegate_.get())
paint_delegate_.reset(NULL);
// Remove the reference to the window handle.
UIT_ClearMainWndHandle();
@@ -789,11 +799,11 @@ void CefBrowserImpl::UIT_DestroyBrowser() {
request_context_proxy_.release());
}
// Remove the reference added in UIT_CreateBrowser().
Release();
// Remove the browser from the list maintained by the context.
_Context->RemoveBrowser(this);
// Remove the reference added in UIT_CreateBrowser().
Release();
}
void CefBrowserImpl::UIT_CloseBrowser() {