[Pkg-telepathy-commits] [telepathy-mission-control-6] 68/90: mc-debug-server: if we have several reasons to stop, don't crash

Simon McVittie smcv at debian.org
Wed May 14 12:09:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-mission-control-6.

commit 9ea179a97d957e41be9eccc03236e254220c3ad2
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Wed Apr 2 12:25:40 2014 +0100

    mc-debug-server: if we have several reasons to stop, don't crash
    
    Previously, when the session and (fake) system bus closed (simultaneously,
    because they are in fact the same dbus-daemon), we would call
    mcd_mission_abort() for the first one. That results in
    a call to tp_clear_object (&mcd), and then the second call to
    mcd_mission_abort (mcd) would crash with a critical warning, because
    MCD_IS_MISSION (NULL) is false.
---
 tests/twisted/mc-debug-server.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/tests/twisted/mc-debug-server.c b/tests/twisted/mc-debug-server.c
index 644dd40..33da426 100644
--- a/tests/twisted/mc-debug-server.c
+++ b/tests/twisted/mc-debug-server.c
@@ -57,7 +57,12 @@ bus_closed (GDBusConnection *connection,
         g_quark_to_string (error->domain), error->code, error->message);
 
   g_dbus_connection_set_exit_on_close (connection, FALSE);
-  mcd_mission_abort ((McdMission *) mcd);
+
+  if (mcd != NULL)
+    {
+      g_message ("Aborting because D-Bus connection has closed");
+      mcd_mission_abort ((McdMission *) mcd);
+    }
 }
 
 static gboolean
@@ -79,9 +84,17 @@ on_abort (gpointer unused G_GNUC_UNUSED)
 static gboolean
 delayed_abort (gpointer data G_GNUC_UNUSED)
 {
-    g_message ("Aborting by popular request");
-    mcd_mission_abort ((McdMission *) mcd);
-    return FALSE;
+  if (mcd != NULL)
+    {
+      g_message ("Aborting as requested via D-Bus");
+      mcd_mission_abort ((McdMission *) mcd);
+    }
+  else
+    {
+      g_message ("mcd has already gone away");
+    }
+
+  return FALSE;
 }
 
 static gboolean

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-mission-control-6.git



More information about the Pkg-telepathy-commits mailing list