Hi Glade people,

I'm having trouble destroying UIs that are built with Glade.
The root of the problem seems to be the reference-counted widgets
attached to other widgets via gtk_object_set_data_full by Glade.

When I close the top-level widget, goes into its finalize phase.
gtk_object_finalize() in turn calls glib's g_datalist_clear():

        void
        g_datalist_clear (GData **datalist)
        {
          g_return_if_fail (datalist != NULL);

          G_LOCK (g_dataset_global);
          if (!g_dataset_location_ht)
            g_data_initialize ();

          while (*datalist)
            g_datalist_clear_i (datalist);
          G_UNLOCK (g_dataset_global);
        }

So g_datalist_clear() gets the g_dataset_global lock and starts
clearing out items in its list.  One of these turns out to be a
widget that we've attached to, whose _full delete function is
gtk_object_unref().  The attached widget gets unreffed, destroyed,
and finalized, and we wind up back in g_datalist_clear() for
widget #2.  This time, though, we can't get the g_dataset_global
lock, because widget #1 still has the lock.  We stop dead:

Here's a pstack of what I just described:

 feb3c5c8 _mutex_adaptive_lock (febdc078, 4c00, feb5c55c, 1, 4d58, fffeffff) + 120
 feb3c378 _cmutex_lock (febdc078, ff, feab3938, febab77c, 0, 0) + 50
 febab77c g_datalist_clear (19bdb4, 0, ff3dd574, 3400, feb5c55c, 0) + d8
 ff0e3dbc gtk_object_finalize (19bda8, ff0e3db0, 19bda8, 3400, feb5c55c, ff3bffac) + c
 ff159b90 gtk_widget_finalize (19bda8, ff159a18, 1, 3400, ff3dc7ac, 109) + 178
 ff0e701c gtk_object_unref (19bda8, ba15, 10, 5800, 16afa8, 11) + 1bc
 ff15b520 gtk_widget_unref (19bda8, bc680, feab3938, feab3938, 1a7500, 39) + f0
 febab7fc g_datalist_clear (18aa04, 0, feab3938, 3400, 1, 0) + 158
 ff0e3dbc gtk_object_finalize (18a9f8, ff0e3db0, 18a9f8, c5efc, a3000, a3000) + c
 ff159b90 gtk_widget_finalize (18a9f8, ff159a18, 0, 5c00, 18a9f8, 90000) + 178
 ff15e180 gtk_window_finalize (18a9f8, ff15e040, 0, 3400, ff264360, 1) + 140
 ff0e701c gtk_object_unref (18a9f8, 18a9f8, 87, ffbedb18, 0, ff176318) + 1bc
 ff10be8c gtk_signal_real_emit (18a9f8, 87, ffbedb18, 1, ffbede78, ff176318) + 5b8
 ff108d08 gtk_signal_emit (18a9f8, 87, ec484, ffbedb18, ff161cd0, 0) + 248
 ff26669c gnome_dialog_button_clicked (19bd60, 18a9f8, ffbee610, 1, ffbee96c, 10000) + 
188

It's possible that this hasn't popped up before because G_LOCK is
#defined to whitespace in glib.h if G_THREADS_ENABLED isn't turned on.

I like glade a lot, and am/was in the middle of moving the newsreader
Pan to glade, but this is a showstopper for me.  (And I'd rather not
redo the GUIs I've built with Glade. :) Do you have any suggestions,
work arounds, CVS fixes?  Please CC them to my mail address, as I'm
not subscribed to this list.

cheers,
Charles

+---------------------------------------------------------------------+
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the line "unsubscribe glade-devel" in the body of the message.

Reply via email to