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

Unified Diff: views/controls/menu/native_menu_gtk.cc

Issue 328002: Assertion failure fix (Closed)
Patch Set: Created 11 years, 2 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: views/controls/menu/native_menu_gtk.cc
diff --git a/views/controls/menu/native_menu_gtk.cc b/views/controls/menu/native_menu_gtk.cc
index b5e59c0e961ea76a73e690366b27dcac1da32696..a50b9b8275849d43fc91a0fb5a11b3aed51b74ca 100644
--- a/views/controls/menu/native_menu_gtk.cc
+++ b/views/controls/menu/native_menu_gtk.cc
@@ -86,10 +86,15 @@ void NativeMenuGtk::RunMenuAt(const gfx::Point& point, int alignment) {
DCHECK(!menu_shown_);
menu_shown_ = true;
+ // Listen for "hide" signal so that we know when to return from the blocking
+ // RunMenuAt call.
+ gint handle_id =
+ g_signal_connect(G_OBJECT(menu_), "hide", G_CALLBACK(OnMenuHidden), this);
// Block until menu is no longer shown by running a nested message loop.
MessageLoopForUI::current()->Run(NULL);
+ g_signal_handler_disconnect(G_OBJECT(menu_), handle_id);
menu_shown_ = false;
}
@@ -223,9 +228,6 @@ void NativeMenuGtk::ResetMenu() {
if (menu_)
gtk_widget_destroy(menu_);
menu_ = gtk_menu_new();
- // Listen for "hide" signal so that we know when to return from the blocking
- // RunMenuAt call.
- g_signal_connect(G_OBJECT(menu_), "hide", G_CALLBACK(OnMenuHidden), this);
}
// static
« 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