diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-01 16:57:13 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-01 16:57:13 +0000 |
commit | 7c9d829192359328576965fe8a4a52a5ad6c7da3 (patch) | |
tree | 6f06ef0a1bd4f797ad2c9f2968950b625867136c /chrome/browser/views | |
parent | 9d3fcf8bc99dfdfef66b983af69802ddbe76514d (diff) | |
download | chromium_src-7c9d829192359328576965fe8a4a52a5ad6c7da3.zip chromium_src-7c9d829192359328576965fe8a4a52a5ad6c7da3.tar.gz chromium_src-7c9d829192359328576965fe8a4a52a5ad6c7da3.tar.bz2 |
Attempt at fixing leaks from SetProp. Apparently there is a finite
amount of memory reserved for properties and Windows doesn't always
automatically free up the memory if the window is deleted without an
explicit remove. For the time being I've made it easier to track
SetProp leaks, but we may want to move to using something other than
SetProp in the future that isn't as fragile.
I didn't fix a couple of places that were trickier. I'm going to file
separate bugs on them.
BUG=44991
TEST=none
Review URL: http://codereview.chromium.org/4195003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/generic_info_view_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/tab_contents/tab_contents_view_win.cc | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index bc77707..6a8df4a 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -1849,7 +1849,7 @@ void BrowserView::Init() { // Stow a pointer to this object onto the window handle so that we can get // at it later when all we have is a native view. #if defined(OS_WIN) - SetProp(GetWidget()->GetNativeView(), kBrowserViewKey, this); + GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this); #else g_object_set_data(G_OBJECT(GetWidget()->GetNativeView()), kBrowserViewKey, this); diff --git a/chrome/browser/views/generic_info_view_unittest.cc b/chrome/browser/views/generic_info_view_unittest.cc index 2fa0e9d..6c26603 100644 --- a/chrome/browser/views/generic_info_view_unittest.cc +++ b/chrome/browser/views/generic_info_view_unittest.cc @@ -11,10 +11,11 @@ #include "views/controls/label.h" #include "views/controls/textfield/textfield.h" #include "views/widget/root_view.h" +#include "views/window/window.h" + #if defined(OS_WIN) #include "views/widget/widget_win.h" #endif -#include "views/window/window.h" // This class is only used on windows for now. #if defined(OS_WIN) @@ -59,5 +60,6 @@ TEST_F(GenericInfoViewTest, GenericInfoView) { string16 product_desc = l10n_util::GetString(IDS_PRODUCT_DESCRIPTION); EXPECT_EQ(product_name, view2->name_views_[0]->GetText()); EXPECT_EQ(product_desc, view2->name_views_[1]->GetText()); + window->CloseNow(); } #endif // OS_WIN diff --git a/chrome/browser/views/tab_contents/tab_contents_view_win.cc b/chrome/browser/views/tab_contents/tab_contents_view_win.cc index ce6bf8ed..f3126d1 100644 --- a/chrome/browser/views/tab_contents/tab_contents_view_win.cc +++ b/chrome/browser/views/tab_contents/tab_contents_view_win.cc @@ -145,6 +145,8 @@ void TabContentsViewWin::OnDestroy() { RevokeDragDrop(GetNativeView()); drop_target_ = NULL; } + + WidgetWin::OnDestroy(); } void TabContentsViewWin::SetPageTitle(const std::wstring& title) { |