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

Unified Diff: chrome/browser/gtk/menu_gtk.cc

Issue 552044: Gtk: fix reference counting/destruction of GtkMenu* in MenuGtk.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/menu_gtk.cc
===================================================================
--- chrome/browser/gtk/menu_gtk.cc (revision 36530)
+++ chrome/browser/gtk/menu_gtk.cc (working copy)
@@ -28,6 +28,7 @@
menu_(gtk_menu_new()),
factory_(this) {
DCHECK(menu_data);
+ g_object_ref_sink(menu_);
ConnectSignalHandlers();
BuildMenuIn(menu_, menu_data);
}
@@ -38,6 +39,7 @@
dummy_accel_group_(gtk_accel_group_new()),
menu_(gtk_menu_new()),
factory_(this) {
+ g_object_ref_sink(menu_);
ConnectSignalHandlers();
}
@@ -48,6 +50,7 @@
dummy_accel_group_(gtk_accel_group_new()),
menu_(gtk_menu_new()),
factory_(this) {
+ g_object_ref_sink(menu_);
DCHECK(model);
ConnectSignalHandlers();
if (model)
@@ -55,6 +58,9 @@
}
MenuGtk::~MenuGtk() {
+ Cancel();
+ g_object_unref(menu_);
+
STLDeleteContainerPointers(submenus_we_own_.begin(), submenus_we_own_.end());
g_object_unref(dummy_accel_group_);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698