summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 18:45:33 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 18:45:33 +0000
commit72baf67602ab1dbf95c34a5d8301e0ac5f8b8b41 (patch)
treee252a2a806984d70e42196e4d982222d4aad8ec2 /chrome/browser
parentca967acb9a3a63fa6838ea5f4a611984082b4f83 (diff)
downloadchromium_src-72baf67602ab1dbf95c34a5d8301e0ac5f8b8b41.zip
chromium_src-72baf67602ab1dbf95c34a5d8301e0ac5f8b8b41.tar.gz
chromium_src-72baf67602ab1dbf95c34a5d8301e0ac5f8b8b41.tar.bz2
Destroy browser/content related C++ object on WM_DESTROY message, rather than OnFinalMessage
Review URL: http://codereview.chromium.org/115034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/external_tab_container.cc6
-rw-r--r--chrome/browser/external_tab_container.h3
2 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc
index 9fd060e..bf6dfd8 100644
--- a/chrome/browser/external_tab_container.cc
+++ b/chrome/browser/external_tab_container.cc
@@ -130,7 +130,6 @@ bool ExternalTabContainer::Uninitialize(HWND window) {
}
void ExternalTabContainer::OnFinalMessage(HWND window) {
- Uninitialize(window);
delete this;
}
@@ -145,6 +144,11 @@ LRESULT ExternalTabContainer::OnSize(UINT, WPARAM, LPARAM, BOOL& handled) {
return 0;
}
+LRESULT ExternalTabContainer::OnDestroy(UINT, WPARAM, LPARAM, BOOL& handled) {
+ Uninitialize(m_hWnd);
+ return 0;
+}
+
void ExternalTabContainer::OpenURLFromTab(TabContents* source,
const GURL& url,
const GURL& referrer,
diff --git a/chrome/browser/external_tab_container.h b/chrome/browser/external_tab_container.h
index cc794a7..a9aab87 100644
--- a/chrome/browser/external_tab_container.h
+++ b/chrome/browser/external_tab_container.h
@@ -40,6 +40,7 @@ class ExternalTabContainer : public TabContentsDelegate,
public:
BEGIN_MSG_MAP(ExternalTabContainer)
MESSAGE_HANDLER(WM_SIZE, OnSize)
+ MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
END_MSG_MAP()
DECLARE_WND_CLASS(chrome::kExternalTabWindowClass)
@@ -140,7 +141,7 @@ class ExternalTabContainer : public TabContentsDelegate,
protected:
LRESULT OnSize(UINT, WPARAM, LPARAM, BOOL& handled);
- void OnDestroy();
+ LRESULT OnDestroy(UINT, WPARAM, LPARAM, BOOL& handled);
void OnFinalMessage(HWND window);
protected: