On Thu, 18 Nov 2010 22:11:45 +0000
N James Bridge <ja...@xmas.demon.co.uk> wrote:

> It seems that g_object_unref (ptr) doesn't set ptr to NULL when it
> frees the allocated memory. Have I got something wrong here? Do I
> have to do it explicitly?

You can do it explicitely by using

  g_object_add_weak_pointer (your_object, (gpointer) &your_object)

which sets your_object to NULL when it is destroyed. See
http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-add-weak-pointer
for more information. Note that this will only work for the variable
your_object. For other pointers to the object you'd have to do the same.

  - Jannis
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to