Blob Blame History Raw
commit 2cf62d7ff7d3a7bc450d0b60bb81a8365ffd310b
Author: Ross Burton <ross@burtonini.com>
Date:   Wed Feb 27 14:19:48 2008 +0000

    Fix pending call cancelling in proxy dispose
    
    The dispose treated the hash values as DBusGProxyCall objects, but they are
    DBusPendingCall (thanks Dafyd Harries).

diff --git a/dbus/dbus-gproxy.c b/dbus/dbus-gproxy.c
index 3d5a0c5..1244151 100644
--- a/dbus/dbus-gproxy.c
+++ b/dbus/dbus-gproxy.c
@@ -1419,13 +1419,14 @@ dbus_g_proxy_class_init (DBusGProxyClass *klass)
                   G_TYPE_NONE, 2, DBUS_TYPE_MESSAGE, G_TYPE_POINTER);
 }
 
-static void
+static gboolean
 cancel_pending_call (gpointer key, gpointer val, gpointer data)
 {
-  DBusGProxyCall *call = key;
-  DBusGProxy *proxy = data;
+  DBusPendingCall *pending = val;
 
-  dbus_g_proxy_cancel_call (proxy, call);
+  dbus_pending_call_cancel (pending);
+
+  return TRUE;
 }
 
 static void
@@ -1440,7 +1441,7 @@ dbus_g_proxy_dispose (GObject *object)
     }
 
   /* Cancel outgoing pending calls */
-  g_hash_table_foreach (priv->pending_calls, cancel_pending_call, proxy);
+  g_hash_table_foreach_remove (priv->pending_calls, cancel_pending_call, NULL);
   g_hash_table_destroy (priv->pending_calls);
   priv->pending_calls = NULL;