Re: none
- From: Havoc Pennington <hp redhat com>
- To: Owen Taylor <otaylor redhat com>
- Cc: gtk-devel-list gnome org
- Subject: Re: none
- Date: 13 Dec 2000 23:52:09 -0500
Owen Taylor <otaylor redhat com> writes:
> If you want weakrefs, and think object data is inconvenient, then
> we should spend the two minutes to port:
>
> void gtk_object_weakref (GtkObject *object,
> GtkDestroyNotify notify,
> gpointer data);
> void gtk_object_weakunref (GtkObject *object,
> GtkDestroyNotify notify,
> gpointer data);
>
> Though note that the only differences between this and
> g_object_set_data_full are a) the presence use of a key, and b)
> the order of the arguments.
>
> Clarifying that ::destroy is a "disconnect everything" command
> rather than notification of the object being freed or going
> into a "destroyed" state is a major conceptual win for GTK+-2.0.
>
I think most connections to destroy actually are semantically intended
to happen on "disconnect everything" rather than "object destroyed"
(since with any kind of garbage collection, even lame gc such as
refcounting, you should not depend on finalization to happen at any
special time; what you care about is when the object has been
explicitly disconnected from the rest of the app - i.e. "destroy" is
basically "everyone stop using this object so it will get collected"
while a weak ref is "tell everyone this object has been collected").
I'm not sure it's actually interesting to know when an object has been
garbage collected, and I'm not sure we should be encouraging people to
put significant code in the finalizer, which is basically what we are
doing here.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]