[empathy/gnome-2-34] Minimize the scope in which we use TpyCallChannel



commit 71403238333ea70c8ffb6b58a066eef5715c29a7
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date:   Wed Mar 23 15:00:08 2011 +0000

    Minimize the scope in which we use TpyCallChannel

 src/empathy-call-window.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 2c8c860..fdb7532 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -2547,9 +2547,6 @@ static void
 start_call (EmpathyCallWindow *self)
 {
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
-  TpyCallChannel *call;
-
-  g_object_get (priv->handler, "call-channel", &call, NULL);
 
   priv->call_started = TRUE;
   empathy_call_handler_start_call (priv->handler,
@@ -2557,7 +2554,11 @@ start_call (EmpathyCallWindow *self)
 
   if (empathy_call_handler_has_initial_video (priv->handler))
     {
-      TpySendingState s = tpy_call_channel_get_video_state (call);
+      TpyCallChannel *call;
+      TpySendingState s;
+
+      g_object_get (priv->handler, "call-channel", &call, NULL);
+      s = tpy_call_channel_get_video_state (call);
 
       if (s == TPY_SENDING_STATE_PENDING_SEND ||
           s == TPY_SENDING_STATE_SENDING)
@@ -2579,9 +2580,9 @@ start_call (EmpathyCallWindow *self)
               add_video_preview_to_pipeline (self);
             }
         }
-    }
 
-  g_object_unref (call);
+      g_object_unref (call);
+    }
 }
 
 static gboolean



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]