[telepathy-glib/master] TpProxyPendingCall: fix rare crash when cancelled before we've been given our DBusGProxyCall

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Jul 9 01:53:14 PDT 2009


One of the telepathy-mission-control regression tests hit an assertion
failure in dbus_g_proxy_cancel_call (., call=0x0), with
tp_proxy_pending_call_lost_weak_ref on the stack. As far as I can tell,
this can only happen if the weak_object is finalized before
tp_proxy_pending_call_v0_take_pending_call is called, which seems unlikely
but possible.

Reviewed-by: Will Thompson <will.thompson at collabora.co.uk>
---
 telepathy-glib/proxy-methods.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/telepathy-glib/proxy-methods.c b/telepathy-glib/proxy-methods.c
index 58d8bfb..011dcd8 100644
--- a/telepathy-glib/proxy-methods.c
+++ b/telepathy-glib/proxy-methods.c
@@ -332,7 +332,7 @@ tp_proxy_pending_call_cancel (TpProxyPendingCall *pc)
           _tp_proxy_pending_call_idle_completed);
     }
 
-  if (!pc->dbus_completed)
+  if (!pc->dbus_completed && pc->pending_call != NULL)
     {
       /* Implicitly asserts that iface_proxy is non-NULL */
       DBusGProxy *iface_proxy = g_object_ref (pc->iface_proxy);
-- 
1.5.6.5



More information about the telepathy-commits mailing list