]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed handlers registration in DoPopupMenu (patch 1009949)
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 16 Aug 2004 13:13:30 +0000 (13:13 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 16 Aug 2004 13:13:30 +0000 (13:13 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28816 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/window.cpp
src/gtk1/window.cpp

index 8f3eadcf974fc1e2db03a0db60c15b15993e9dce..a461e3b7e889eb862560e142e1ea9d34c47e4649 100644 (file)
@@ -4304,10 +4304,10 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
 
     bool is_waiting = true;
 
 
     bool is_waiting = true;
 
-    gtk_signal_connect( GTK_OBJECT(menu->m_menu),
-                        "hide",
-                        GTK_SIGNAL_FUNC(gtk_pop_hide_callback),
-                        (gpointer)&is_waiting );
+    gulong handler = gtk_signal_connect( GTK_OBJECT(menu->m_menu),
+                                         "hide",
+                                         GTK_SIGNAL_FUNC(gtk_pop_hide_callback),
+                                         (gpointer)&is_waiting );
 
     wxPoint pos;
     gpointer userdata;
 
     wxPoint pos;
     gpointer userdata;
@@ -4344,6 +4344,8 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
         gtk_main_iteration();
     }
 
         gtk_main_iteration();
     }
 
+    gtk_signal_disconnect(GTK_OBJECT(menu->m_menu), handler);
+
     return true;
 }
 
     return true;
 }
 
index 8f3eadcf974fc1e2db03a0db60c15b15993e9dce..a461e3b7e889eb862560e142e1ea9d34c47e4649 100644 (file)
@@ -4304,10 +4304,10 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
 
     bool is_waiting = true;
 
 
     bool is_waiting = true;
 
-    gtk_signal_connect( GTK_OBJECT(menu->m_menu),
-                        "hide",
-                        GTK_SIGNAL_FUNC(gtk_pop_hide_callback),
-                        (gpointer)&is_waiting );
+    gulong handler = gtk_signal_connect( GTK_OBJECT(menu->m_menu),
+                                         "hide",
+                                         GTK_SIGNAL_FUNC(gtk_pop_hide_callback),
+                                         (gpointer)&is_waiting );
 
     wxPoint pos;
     gpointer userdata;
 
     wxPoint pos;
     gpointer userdata;
@@ -4344,6 +4344,8 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
         gtk_main_iteration();
     }
 
         gtk_main_iteration();
     }
 
+    gtk_signal_disconnect(GTK_OBJECT(menu->m_menu), handler);
+
     return true;
 }
 
     return true;
 }