~ted/libindicate/server-hide

« back to all changes in this revision

Viewing changes to libindicate/listener.c

  • Committer: Ted Gould
  • Author(s): Aurélien Gâteau
  • Date: 2009-11-04 17:51:08 UTC
  • mfrom: (339.2.2 libindicate)
  • Revision ID: ted@canonical.com-20091104175108-o0uxaf1wuln3qa29
Unreference and remove signals from dbus proxies and bus correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
238
238
{
239
239
        IndicateListener * listener = INDICATE_LISTENER(obj);
240
240
        IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener);
 
241
 
 
242
        dbus_g_proxy_disconnect_signal(priv->dbus_proxy_session, "NameOwnerChanged",
 
243
                                       G_CALLBACK(dbus_owner_change), listener);
 
244
        dbus_g_proxy_disconnect_signal(priv->dbus_proxy_system, "NameOwnerChanged",
 
245
                                       G_CALLBACK(dbus_owner_change), listener);
241
246
        
242
247
        if (priv->todo_idle != 0) {
243
248
                g_idle_remove_by_data(obj);
249
254
        g_list_free(priv->proxies_possible);
250
255
        g_list_foreach(priv->proxies_working, (GFunc)proxy_struct_destroy, NULL);
251
256
        g_list_free(priv->proxies_working);
 
257
 
 
258
        g_object_unref(priv->dbus_proxy_session);
 
259
        g_object_unref(priv->dbus_proxy_system);
 
260
 
 
261
        dbus_g_connection_unref(priv->session_bus);
 
262
        dbus_g_connection_unref(priv->system_bus);
 
263
 
252
264
        G_OBJECT_CLASS (indicate_listener_parent_class)->finalize (obj);
253
265
        return;
254
266
}
281
293
static void
282
294
dbus_owner_change (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, IndicateListener * listener)
283
295
{
 
296
        g_return_if_fail(INDICATE_IS_LISTENER(listener));
284
297
        IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener);
285
298
 
286
299
        /* If someone is getting on the bus we add them to the