Re: GtkWindow destroy problem



Darin Adler <darin bentspoon com> writes:

> on 9/5/01 11:42 PM, Tim Janik at timj gtk org wrote:
> 
> > not in GtkObject, since this is valid code (apart from GTK_TYPE_OBEJCT
> > being abstract):
> > o = g_object_new (GTK_TYPE_OBJECT, NULL);
> > gtk_object_unref (o);
> 
> If anyone other than you tried to tell me this was valid, I would tell him
> he was wrong.
> 
> Havoc has drilled it into my head over the last year that the floating
> reference cannot be legally removed with unref.

Ok, so just to make sure I did it right, is the following correct ?

  o = g_object_new (GTK_TYPE_WINDOW, NULL);
  gtk_object_ref (o);
  gtk_object_sink (o);
  /* ... some time later ... */
  g_object_unref (o);

-- 
Martin Baulig
martin gnome org (private)
baulig suse de (work)




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