bonobo-control wrongness



When you ungracefully kill the evolution shell, the components crash
(well, at least mail definitely does) because
bonobo_control_plug_destroy_event_cb and
bonobo_control_plug_destroy_cb both get called and both unref the
control.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/bonobo/ChangeLog,v
retrieving revision 1.958
diff -u -r1.958 ChangeLog
--- ChangeLog	2001/02/13 18:59:26	1.958
+++ ChangeLog	2001/02/13 20:47:43
@@ -1,3 +1,10 @@
+2001-02-13  Dan Winship  <danw ximian com>
+
+	* bonobo/bonobo-control.c (impl_Bonobo_Control_setWindowId): Use
+	gtk_signal_connect_while_alive so we don't try to destroy the
+	control on both the "destroy_event" and "destroy" signals from the
+	plug.
+
 2001-02-13  Darin Adler  <darin eazel com>
 
 	* .cvsignore: Fix for recent xml-i18n-tools.
Index: bonobo/bonobo-control.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-control.c,v
retrieving revision 1.65
diff -u -r1.65 bonobo-control.c
--- bonobo/bonobo-control.c	2001/02/08 23:37:42	1.65
+++ bonobo/bonobo-control.c	2001/02/13 20:47:43
@@ -301,10 +301,12 @@
 		/* Create the new plug */
 		control->priv->plug = bonobo_plug_new (x11_id);
 
-		gtk_signal_connect (GTK_OBJECT (control->priv->plug), "destroy_event",
-				    GTK_SIGNAL_FUNC (bonobo_control_plug_destroy_event_cb), control);
-		gtk_signal_connect (GTK_OBJECT (control->priv->plug), "destroy",
-				    GTK_SIGNAL_FUNC (bonobo_control_plug_destroy_cb), control);
+		gtk_signal_connect_while_alive (GTK_OBJECT (control->priv->plug), "destroy_event",
+						GTK_SIGNAL_FUNC (bonobo_control_plug_destroy_event_cb),
+						control, GTK_OBJECT (control));
+		gtk_signal_connect_while_alive (GTK_OBJECT (control->priv->plug), "destroy",
+						GTK_SIGNAL_FUNC (bonobo_control_plug_destroy_cb),
+						control, GTK_OBJECT (control));
 
 		/*
 		 * Put the control widget inside the plug.  If we




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