Re: GObjectClass.dispose and bringing objects back to life
- From: Dan Winship <danw gnome org>
- To: Tristan Van Berkom <tvb gnome org>
- Cc: gtk-devel-list gnome org
- Subject: Re: GObjectClass.dispose and bringing objects back to life
- Date: Fri, 02 Dec 2011 10:16:18 +0100
On 12/02/2011 07:55 AM, Tristan Van Berkom wrote:
> o References to other GObjects are broken in dispose, and since
> dispose can run multiple times, care must be taken, i.e.:
>
> if (priv->reffed_object != NULL) {
> g_object_unref (priv->reffed_object);
> priv->reffed_object = NULL;
> }
or, if you depend on glib >= 2.28,
g_clear_object (&priv->reffed_object);
-- Dan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]