A fix for sample-container and a question



hi guys,
Everytime I use sample-container after I quit I get errors like
Gtk-Warning **: Invalid cast from `(Unknown)' to `GtkWidget'
Gtk-CRITICAL **: file gtkwidget.c ... (Fill in the rest)

The strange thing is, sometimes this goes to the gnome-termainal I run
sample-container from, sometimes (usually) it goes to the virtual terminal I ran
X from.

Attached at the end is a patch I think fixes it.
Now my question :)

What is the policy for bonobo objects to kill themselves. After running
sample-container with gnomines embedded, the bonobo-application-x-mines is still
running. Is it up to the component to keep track of how many clients/views it
has and destroy itself accordingly, or is it up to the container to explicitly
destroy it, or have I missed some important reason why they stay around? (My guess
is the former solution, as multiple containers can use the one embeddable
process, so we don't want them dying randomly). 

sorry for all teh inconvience :)
Iain

Index: container.c
===================================================================
RCS file: /cvs/gnome/bonobo/samples/compound-doc/container/container.c,v
retrieving revision 1.2
diff -U2 -r1.2 container.c
--- container.c	2000/05/05 13:37:16	1.2
+++ container.c	2000/05/11 00:02:28
@@ -37,4 +37,13 @@
 sample_app_exit (SampleApp *app)
 {
+	GList *l;
+
+	for (l = app->components; l;) {
+		GList *tmp = l->next; /* Store the next pointer 
+					 as component_del invalidates l */
+		component_del (l->data);
+		l = tmp;
+	}
+	
 	bonobo_object_destroy (BONOBO_OBJECT (app->container));
 	gtk_main_quit ();





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