=== modified file 'debian/changelog' --- debian/changelog 2009-10-01 21:31:31 +0000 +++ debian/changelog 2009-11-04 18:05:21 +0000 @@ -1,3 +1,11 @@ +libindicate (0.2.3-0ubuntu2~ppa1) karmic; urgency=low + + * Patch to correctly unref and remove signals from DBus objects + when the object is destroyed. Patch from Aurélien Gâteau. + (LP: #462049) + + -- Ted Gould Wed, 04 Nov 2009 11:57:58 -0600 + libindicate (0.2.3-0ubuntu1) karmic; urgency=low * Upstream release 0.2.3 (LP: #440213) === modified file 'libindicate/listener.c' --- libindicate/listener.c 2009-09-14 15:30:59 +0000 +++ libindicate/listener.c 2009-11-04 18:05:21 +0000 @@ -262,6 +262,11 @@ { IndicateListener * listener = INDICATE_LISTENER(obj); IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener); + + dbus_g_proxy_disconnect_signal(priv->dbus_proxy_session, "NameOwnerChanged", + G_CALLBACK(dbus_owner_change), listener); + dbus_g_proxy_disconnect_signal(priv->dbus_proxy_system, "NameOwnerChanged", + G_CALLBACK(dbus_owner_change), listener); if (priv->todo_idle != 0) { g_idle_remove_by_data(obj); @@ -273,6 +278,13 @@ g_list_free(priv->proxies_possible); g_list_foreach(priv->proxies_working, (GFunc)proxy_struct_destroy, NULL); g_list_free(priv->proxies_working); + + g_object_unref(priv->dbus_proxy_session); + g_object_unref(priv->dbus_proxy_system); + + dbus_g_connection_unref(priv->session_bus); + dbus_g_connection_unref(priv->system_bus); + G_OBJECT_CLASS (indicate_listener_parent_class)->finalize (obj); return; } @@ -307,6 +319,7 @@ static void dbus_owner_change (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, IndicateListener * listener) { + g_return_if_fail(INDICATE_IS_LISTENER(listener)); IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener); /* Figure out which bus we are. */