Re: Emission hooks for parent-set signal.(cont.)



On Tue, 2008-10-07 at 22:21 +0200, Tim Janik wrote:
> On Mon, 6 Oct 2008, Yu Feng wrote:
> 
> >
> > static void
> > gtk_window_destroy (GtkObject *object)
> > {
> >  GtkWindow *window = GTK_WINDOW (object);
> >
> >  toplevel_list = g_slist_remove (toplevel_list, window);
> >
> >  if (window->transient_parent)
> >    gtk_window_set_transient_for (window, NULL);
> >
> >  /* frees the icons */
> >  gtk_window_set_icon_list (window, NULL);
> >
> >  if (window->has_user_ref_count)
> >    {
> >      window->has_user_ref_count = FALSE;
> >      g_object_unref (window);
> >    }
> >
> >  if (window->group)
> >    gtk_window_group_remove_window (window->group, window);
> >
> >   gtk_window_free_key_hash (window);
> >
> >   GTK_OBJECT_CLASS (gtk_window_parent_class)->destroy (object);
> > }
> >
> >
> > Maybe moving the ->destroy line to the beginning of this function can fix the problem?
> 
> Assuming you suggest moving ->destroy() to before
> the g_object_unref() call because you see ref_count
> assertions with your emission hook uses, the answer
> is: No.
> The only way this function can be validly called is
> via a signal emission of the GtkObject::destroy signal.
> And emitting a signal on an instance will ref the
> instance before and unref the instance after
> the emission.

So the ref_count assertions is not produced from here. But I am still
puzzled about how the assertion might comes out from other places. Do
you have any possible explanations?


Yu

> 
> > Yu
> 
> ---
> ciaoTJ
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list



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