Disconnect closed signal from GDBusConnection before creating a new connection.
authorPeng Huang <shawn.p.huang@gmail.com>
Wed, 15 Dec 2010 09:04:43 +0000 (17:04 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Wed, 15 Dec 2010 09:04:43 +0000 (17:04 +0800)
BUG=none
TEST=manual

Review URL: http://codereview.appspot.com/3668041

src/ibusbus.c

index efbce3c..5a3b978 100644 (file)
@@ -188,8 +188,11 @@ _connection_closed_cb (GDBusConnection  *connection,
 static void
 ibus_bus_connect (IBusBus *bus)
 {
-    /* destry old connection at first */
+    /* unref the old connection at first */
     if (bus->priv->connection != NULL) {
+        g_signal_handlers_disconnect_by_func (bus->priv->connection,
+                                              G_CALLBACK (_connection_closed_cb),
+                                              bus);
         g_object_unref (bus->priv->connection);
         bus->priv->connection = NULL;
     }