[10604] in The GTK GIMP ToolKit mailing list archive
[gtk-list] RE: object unref error
daemon@ATHENA.MIT.EDU (Rostedt, Steven)
Wed Dec 2 13:37:46 1998
Date: Wed, 02 Dec 1998 13:00:08 -0500
From: "Rostedt, Steven" <steven.rostedt@lmco.com>
To: "'gtk-list@redhat.com'" <gtk-list@redhat.com>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com
>
> Gtk-CRITICAL **: file gtkobject.c: line 1164 (gtk_object_unref):
> assertion `object != NULL' failed.
>
> yes, object is not null but what on earth does it mean? why does
> it occur in 1.1.5 and not in 1.0.5? The signal connection to the
> OK button is as follows:
>
Actually, the fail is that the object IS NULL.
> dlg = gtk_dialog_new();
> gtk_signal_connect(GTK_OBJECT(dlg), "destroy",
> GTK_SIGNAL_FUNC(gtk_widget_destroyed), &dlg);
> : some code omitted for clarity
> gtk_signal_connect(GTK_OBJECT(okBtn), "clicked",
> (GtkSignalFunc)popupCB, (gpointer)dlg);
>
>
> I don't know what gtk_widget_destroyed does by the way...
>
gtk_widget_destroyed takes one parameter, so you would need
to use the "gtk_signal_connect_object" function instead of
"gtk_signal_connect". But please read on ... :*)
But reguardless, you are trying to call the gtk_widget_destroyed
function
on the "dlg" widget when the "dlg" widget is destroyed.
I'm surprised that this worked in 1.0.5.
So Not fully knowing the internals of GTK, I believe that you
are calling the destroy operation on widget that has already been
destroyed. Thus the "NULL" result!
I had a similar problem in 1.0.6. (I'm still using the so called
"stable" version)
> and the callback is:
>
>
> static void popupCB(GtkWidget *widget, gpointer dlg)
> {
> gtk_widget_destroy((GtkWidget *)dlg);
> }
^^^^^^^
This is the first time the widget is destroyed!
> Any ideas?
>
No but I have lots of opinions ;)
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null