gtkaction: wrong action removed from proxy



The gtk_action_connect_proxy() function has a bug where it doesn't
disconnect actions from proxies correctly.  It goes to the trouble of
looking up the old action, then doesn't remove it before assigning the
new action.  This leaves action callbacks on the proxy that may point to
objects that no longer exist.  I've attached a patch below.

David

P.S. This is a patch from gtk HEAD.  Should I submit a patch for the
libegg version of this code too?


Index: gtk/gtkaction.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkaction.c,v
retrieving revision 1.5
diff -u -r1.5 gtkaction.c
--- gtk/gtkaction.c	4 Sep 2003 21:34:15 -0000	1.5
+++ gtk/gtkaction.c	6 Sep 2003 19:52:46 -0000
@@ -815,7 +815,7 @@
 
   if (prev_action)
     {
-      (* GTK_ACTION_GET_CLASS (action)->disconnect_proxy) (action, proxy);  
+      (* GTK_ACTION_GET_CLASS (action)->disconnect_proxy) (prev_action, proxy);  
     }
 
   (* GTK_ACTION_GET_CLASS (action)->connect_proxy) (action, proxy);

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]