diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-19 05:06:11 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-19 05:06:11 +0000 |
commit | 39f832687ba32bef5baa8ddb05035de59859499a (patch) | |
tree | d92dbf31f988cb06975974d67c838c8cec880e75 /chrome/browser/views | |
parent | 19347f6ff573d2a7d22515ba2bbfb246e34af92b (diff) | |
download | chromium_src-39f832687ba32bef5baa8ddb05035de59859499a.zip chromium_src-39f832687ba32bef5baa8ddb05035de59859499a.tar.gz chromium_src-39f832687ba32bef5baa8ddb05035de59859499a.tar.bz2 |
This is a fix for a memory leak.
AutocompletePopupWin would be leaked when the browser view is closed.
BUG=None
TEST=Make sure Chrome can be opened/closed without crasher.
Review URL: http://codereview.chromium.org/132050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h | 4 | ||||
-rw-r--r-- | chrome/browser/views/autocomplete/autocomplete_popup_win.cc | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h index e5d4bc2..40d6f69 100644 --- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h +++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h @@ -9,12 +9,12 @@ #include "chrome/browser/autocomplete/autocomplete.h" #include "chrome/browser/autocomplete/autocomplete_popup_model.h" #include "chrome/browser/autocomplete/autocomplete_popup_view.h" +#include "chrome/browser/views/autocomplete/autocomplete_popup_win.h" #include "views/view.h" #include "webkit/glue/window_open_disposition.h" class AutocompleteEditModel; class AutocompleteEditViewWin; -class AutocompletePopupWin; class Profile; // An interface implemented by an object that provides data to populate @@ -92,7 +92,7 @@ class AutocompletePopupContentsView : public views::View, void MakeCanvasTransparent(gfx::Canvas* canvas); // The popup that contains this view. - AutocompletePopupWin* popup_; + scoped_ptr<AutocompletePopupWin> popup_; // The provider of our result set. scoped_ptr<AutocompletePopupModel> model_; diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_win.cc b/chrome/browser/views/autocomplete/autocomplete_popup_win.cc index bd3de12..02d3118 100644 --- a/chrome/browser/views/autocomplete/autocomplete_popup_win.cc +++ b/chrome/browser/views/autocomplete/autocomplete_popup_win.cc @@ -29,6 +29,8 @@ void AutocompletePopupWin::Init(AutocompleteEditViewWin* edit_view, // Create the popup WidgetWin::Init(edit_view->parent_view()->GetWidget()->GetNativeView(), contents_->GetPopupBounds(), false); + // The contents is owned by the LocationBarView. + contents_->SetParentOwned(false); SetContentsView(contents_); // When an IME is attached to the rich-edit control, retrieve its window |