GLib-GObject-CRITICAL when disposing a GtkToolbar, GTK bug?



Hi!

I'm getting this message when destroying an VBox which contains a
GtkToolbar:

GLib-GObject-CRITICAL **: g_object_ref: assertion `object->ref_count >
0' failed

I tracked down the source of the problem to the method
gtk_toolbar_finalize. This finalizer removes the arrow button like this:

  if (priv->arrow_button)
    gtk_widget_unparent (priv->arrow_button);

So what happens is that the gtk_widget_unparent call sends the
parent-set signal, and needs to provide the old parent (the toolbar) as
parameter, so it tries to ref the GtkToolbar, and then it shows the
CRITICAL because the GtkToolbar has been already disposed.

I haven't been able to reproduce this problem with a standalone test
app. In the test app I tried for some reason GLib decides that it is not
necessary to send the signal. But it does in my real app. I find it
strange since in both cases I use a stock GtkToolbar and I don't
subscribe any event.

In any case, I'm wondering if this gtk_widget_unparent call is legal in
that context. If it is I'll have to dig further on the problem.

Thanks,
Lluis.





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