Re: GObjectClass.dispose and bringing objects back to life



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]