[telepathy-mission-control/master] McdDispatcher: if a client disappears, end its "readying" immediately

Simon McVittie simon.mcvittie at collabora.co.uk
Thu May 14 08:55:11 PDT 2009


Otherwise, we'll get a use-after-free when the Get("HandledChannels") call
eventually returns.

(I suspect having McdClient be a subclass of TpProxy would be a better
long-term fix for this.)
---
 src/mcd-dispatcher.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 6e6f152..3c989da 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -326,7 +326,14 @@ static void
 mcd_client_free (McdClient *client)
 {
     if (client->proxy)
+    {
+        GError error = { TP_DBUS_ERRORS,
+            TP_DBUS_ERROR_NAME_OWNER_LOST, "Client disappeared" };
+
+        _mcd_object_ready (client->proxy, client_ready_quark, &error);
+
         g_object_unref (client->proxy);
+    }
 
     g_free (client->name);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list