Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1244)

Unified Diff: ui/views/controls/button/button_dropdown.h

Issue 10832184: Fixed memory leak. Untangled confusing code with menu initialization and ownership. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/toolbar_view.cc ('k') | ui/views/controls/button/button_dropdown.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/button_dropdown.h
===================================================================
--- ui/views/controls/button/button_dropdown.h (revision 150365)
+++ ui/views/controls/button/button_dropdown.h (working copy)
@@ -29,6 +29,8 @@
// The button's class name.
static const char kViewClassName[];
+ // Constructor takes ownership of the |model| and destroys
Peter Kasting 2012/08/07 21:32:26 Nit: Allocated with new as opposed to... malloc?
gene 2012/08/07 21:42:37 Done.
+ // object in the destructor. |model| must be allocated with new.
ButtonDropDown(ButtonListener* listener, ui::MenuModel* model);
virtual ~ButtonDropDown();
@@ -67,7 +69,7 @@
private:
// The model that populates the attached menu.
- ui::MenuModel* model_;
+ scoped_ptr<ui::MenuModel> model_;
// Indicates if menu is currently showing.
bool menu_showing_;
« no previous file with comments | « chrome/browser/ui/views/toolbar_view.cc ('k') | ui/views/controls/button/button_dropdown.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698