- Fix a leak of CachedResource objects due to the Cache never being cleared (issue #15).
- Fix a crash when the main application exits while popup windows exist due to a race condition when deleting CefBrowser objects.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@49 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2009-09-26 01:22:33 +00:00
parent 07e81ab0a0
commit 8635aeb5cf
5 changed files with 45 additions and 4 deletions

View File

@@ -64,6 +64,11 @@ LRESULT CALLBACK CefBrowserImpl::WndProc(HWND hwnd, UINT message,
// Clean up anything associated with the WebViewHost widget.
browser->GetWebViewHost()->webwidget()->close();
// Clear the user data pointer.
win_util::SetWindowUserData(hwnd, NULL);
// Remove the reference added in UIT_CreateBrowser().
browser->Release();
// Remove the browser from the list maintained by the context
_Context->RemoveBrowser(browser);
}
@@ -255,6 +260,8 @@ void CefBrowserImpl::UIT_CreateBrowser(const std::wstring& url)
// Set window user data to this object for future reference from the window
// procedure
win_util::SetWindowUserData(window_info_.m_hWnd, this);
// Add a reference that will be released on WM_DESTROY.
AddRef();
// Add the new browser to the list maintained by the context
_Context->AddBrowser(this);