Re: GtkWindow destroy problem
- From: Havoc Pennington <hp redhat com>
- To: Darin Adler <darin bentspoon com>
- Cc: Tim Janik <timj gtk org>, Martin Baulig <martin home-of-linux org>, Gtk Developers <gtk-devel-list gnome org>
- Subject: Re: GtkWindow destroy problem
- Date: 07 Sep 2001 13:46:07 -0400
Darin Adler <darin bentspoon com> writes:
> on 9/7/01 9:58 AM, Tim Janik at timj gtk org wrote:
>
> > but if you use GtkObject in a normally refcounted framework other than the
> > gtk widget framework, you should be able to simply do
> > o = gtk_object_new (GTK_TYPE_OBJECT, NULL);
> > gtk_object_unref (o);
> > and ignore the gtk specific floating kludge.
>
> That's what I thought when I started working with Gtk, but after asking lots
> of questions and learning the framework better, I've learned to always doing
> a sink and ref (often in the initialize function) for objects where I am not
> using the floating feature, rather than relying on the knowledge that no one
> will do a sink. Now I learn that you would rather than I didn't do it that
> way -- something new every day!
>
Well, my view is that hoping no one will ever call sink() is not
particularly good for code maintenance. There's no reason you need to
set this trap for yourself. ;-)
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]