]> git.0d.be Git - empathy.git/commitdiff
Don't destroy the call factory right away (#633816)
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 2 Nov 2010 13:58:03 +0000 (14:58 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 2 Nov 2010 13:58:03 +0000 (14:58 +0100)
src/empathy-av.c

index 6a4688231297e3e2dc3b7e41557fc7e8d6d74814..f6d1f5268d60d145a012cbb660b5a8020d199e29 100644 (file)
@@ -47,6 +47,8 @@ static GtkApplication *app = NULL;
 static gboolean activated = FALSE;
 static gboolean use_timer = TRUE;
 
+static EmpathyCallFactory *call_factory = NULL;
+
 static void
 new_call_handler_cb (EmpathyCallFactory *factory,
     EmpathyCallHandler *handler,
@@ -72,12 +74,12 @@ activate_cb (GApplication *application)
 {
   if (!use_timer && !activated)
     {
-      EmpathyCallFactory *call_factory;
       GError *error = NULL;
 
       /* keep a 'ref' to the application */
       g_application_hold (G_APPLICATION (app));
 
+      g_assert (call_factory == NULL);
       call_factory = empathy_call_factory_initialise ();
 
       g_signal_connect (G_OBJECT (call_factory), "new-call-handler",
@@ -90,8 +92,6 @@ activate_cb (GApplication *application)
         }
 
       activated = TRUE;
-
-      g_object_unref (call_factory);
     }
 }
 
@@ -158,6 +158,7 @@ main (int argc,
   retval = g_application_run (G_APPLICATION (app), argc, argv);
 
   g_object_unref (app);
+  tp_clear_object (&call_factory);
 
 #ifdef ENABLE_DEBUG
   g_object_unref (debug_sender);