[10626] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: object unref error

daemon@ATHENA.MIT.EDU (D. Emilio Grimaldo Tunon)
Thu Dec 3 04:01:55 1998

Date: Thu, 03 Dec 1998 09:57:05 +0100
From: "D. Emilio Grimaldo Tunon" <emilio_tunon@nl.compuware.com>
To: gtk-list@redhat.com
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

David Given wrote:

> the button, and your callback gets called. When you call gtk_widget_destroy(),
> the "destroy" signal fires. AFAIK gtk_widget_destroyed attempts to destroy the
> current widget. So you end up destroying it twice.
> 

> Try instead of the second gtk_signal_connect() this:
> 
>         gtk_signal_connect_object(
>                 GTK_OBJECT(okBtn),      // Object signal is attached to
>                 "clicked",              // Signal name
>                 GTK_SIGNAL_FUNC(gtk_widget_destroyed), // Callback
>                 GTK_OBJECT(dlg),        // Object actually passed to callback
>                 NULL);                  // User data
> 
> Of course, I could be entirely wrong. Feel free to correct me.


Thanks, but I have to tell ya' :-) gtk_sig*_object() only takes
4 parameters so the last NULL shouldn't be there. I tried this
in various combinations (allowing for typos) and didn't get it
to work, once I removed the NULL and ran it:

1) gtk_widget_destroy + dlg
   click OK button results in **Gdk-Message ERROR: sigseg caught

2) gtk_widget_destroyed + dlg

   click OK button, usually the dialog does *not* get destroyed.
   A Gtk-Warning "Invalid unclassed pointer in cast to GtkObject"
   followed in some ocassions by a sigsev.

3) popupCB + dlg (popupCB uses gtk_widget_destroy()

   press OK causes Gtk-CRITICAL gtkobject.c line 1164 gtk_object_unref
   assertion object != NULL failed. The dialog *does* disappear and
   the application runs without a sudden stroke.

So, any more suggestions anyone?
    

-- 
D. Emilio Grimaldo Tunon       Compuware Europe B.V. (Uniface Lab)
Software Engineer	       Amsterdam, The Netherlands
emilio_tunon@nl.compuware.com  Tel. +31 (0)20 3126 516
*** The opinions expressed hereby are mine and not my employer's ***

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post