GNOME Bugzilla – Bug 673555
gnome-settings-daemon unrefs member objects twice when dispose
Last modified: 2012-05-23 14:16:22 UTC
Created attachment 211356 [details] [review] patch gnome_settings_manager_stop() is called from gnome_settings_manager_dispose(), which may be called multiple times. However, there lacks non-NULL checks before g_object_unref().
Could just use g_clear_object here
Created attachment 214234 [details] [review] patch
Review of attachment 214234 [details] [review]: In the docs for g_clear_object: "object_ptr must not be NULL."
Fixed the problem mentioned and committed to master and gnome-3-4
(In reply to comment #3) > Review of attachment 214234 [details] [review]: > > In the docs for g_clear_object: "object_ptr must not be NULL." I wrote: g_clear_object (&manager->priv->settings); Note that it is a pointer to a struct member and the pointer will never be NULL. You changed it to: if (manager->priv->settings) g_clear_object (&manager->priv->settings); The NULL check is redundant.
I meant, the doc says "object_ptr must not be NULL" not "*object_ptr must not be NULL", like the way passing around GError **.
Sorry for reopening such a minor issue, but I think the wrong commit should be fixed, as it will perhaps make the g_clear_object usage misleading.
commit ea8f5d1e00fad8e526af243a89de1d5aff88e4e8 Author: Daiki Ueno <ueno@unixuser.org> Date: Wed May 23 15:15:16 2012 +0100 daemon: Fix g_clear_object() usage https://bugzilla.gnome.org/show_bug.cgi?id=673555