]> git.0d.be Git - empathy.git/commitdiff
Make the dispatch operation _get_ functions not return a ref
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Fri, 9 Jan 2009 16:15:27 +0000 (16:15 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 9 Jan 2009 16:15:27 +0000 (16:15 +0000)
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
svn path=/trunk/; revision=2188

libempathy-gtk/empathy-ui-utils.c
libempathy/empathy-chatroom-manager.c
libempathy/empathy-dispatch-operation.c
libempathy/empathy-dispatcher.c
libempathy/empathy-tp-chat.c
libempathy/empathy-utils.c
src/empathy-event-manager.c
src/empathy-tube-dispatch.c
src/empathy.c

index 7e16fd6e076bca94d15c216b8bc0c0efa2c8cc46..effeb7a01df3a240b0e9798878a48a59c1aad2b9 100644 (file)
@@ -1443,7 +1443,6 @@ file_manager_send_file_request_cb (EmpathyDispatchOperation *operation,
        empathy_tp_file_offer (tp_file, file, NULL);
 
        g_object_unref (file);
-       g_object_unref (tp_file);
 }
 
 static void
index 282d7ed71ed4fd42efe0e3c561829040534337e8..0a637a440d5d2dd7ea1ede6d32744a1963dff4ec 100644 (file)
@@ -701,7 +701,7 @@ chatroom_manager_observe_channel_cb (EmpathyDispatcher *dispatcher,
   tp_channel_get_handle (channel, &handle_type);
 
   if (handle_type != TP_HANDLE_TYPE_ROOM)
-    goto out;
+    return;
 
   chat = EMPATHY_TP_CHAT (
     empathy_dispatch_operation_get_channel_wrapper (operation));
@@ -724,10 +724,6 @@ chatroom_manager_observe_channel_cb (EmpathyDispatcher *dispatcher,
   g_signal_connect (chat, "destroy",
     G_CALLBACK (chatroom_manager_chat_destroyed_cb),
     manager);
-
-  g_object_unref (chat);
-out:
-  g_object_unref (channel);
 }
 
 void
index c623dbfd2355922800c30893b88ad1821649e8e8..def9e43e18ccfd4f9f3d00c0e49a4b3dfff0b9f8 100644 (file)
@@ -526,7 +526,7 @@ empathy_dispatch_operation_get_channel (EmpathyDispatchOperation *operation)
 
   priv = GET_PRIV (operation);
 
-  return TP_CHANNEL (g_object_ref (priv->channel));
+  return priv->channel;
 }
 
 GObject *
@@ -539,9 +539,6 @@ empathy_dispatch_operation_get_channel_wrapper (
 
   priv = GET_PRIV (operation);
 
-  if (priv->channel_wrapper != NULL)
-    g_object_ref (priv->channel_wrapper);
-
   return priv->channel_wrapper;
 }
 
index 0d67336c78e98de7ee65a5ff89bd6ddbc1fcc1a3..bde8b6a1a9e4ed912894c4e88ede6b482f0264af 100644 (file)
@@ -118,8 +118,8 @@ static DispatchData *
 new_dispatch_data (TpChannel *channel, GObject *channel_wrapper)
 {
   DispatchData *d = g_slice_new0 (DispatchData);
-  d->channel = channel;
-  d->channel_wrapper = channel_wrapper;
+  d->channel = g_object_ref (channel);
+  d->channel_wrapper = g_object_ref (channel_wrapper);
 
   return d;
 }
index 57e3277ebe51500cd42ed62e6e661a616196508b..bfcdd1a4c890a15828502ea7fbad4a3abe885981 100644 (file)
@@ -1053,7 +1053,7 @@ tp_chat_set_property (GObject      *object,
 
        switch (param_id) {
        case PROP_CHANNEL:
-               priv->channel = g_object_ref (g_value_get_object (value));
+               priv->channel = g_value_dup_object (value);
                break;
        default:
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
@@ -1187,6 +1187,7 @@ empathy_tp_chat_close (EmpathyTpChat *chat) {
           We loose the ordering of sent messages though */
        g_signal_handlers_disconnect_by_func (priv->channel,
                tp_chat_invalidated_cb, chat);
+
        tp_cli_channel_call_close (priv->channel, -1, tp_chat_async_cb,
                "closing channel", NULL, NULL);
 
index 7545266088c0e933da83d452c89ee428db35d576..4fc12085a7f8923f87cf685d7ff2d562c74be236 100644 (file)
@@ -470,8 +470,6 @@ empathy_call_request_cb (EmpathyDispatchOperation *operation,
           empathy_dispatch_operation_get_channel_wrapper (operation));
 
       empathy_tp_call_to (call, contact);
-
-      g_object_unref (call);
     }
 
   g_object_unref (contact);
index 53c3b84d98333dd03d04c22e3c22729f421e182c..3c7541c8200dbe4577802a4aed5642a5000fc5e7 100644 (file)
@@ -381,7 +381,6 @@ event_manager_approve_channel_cb (EmpathyDispatcher *dispatcher,
 
       g_signal_connect (tp_chat, "message-received",
         G_CALLBACK (event_manager_chat_message_received_cb), approval);
-      g_object_unref (G_OBJECT (tp_chat));
 
     }
   else if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA))
@@ -430,7 +429,6 @@ event_manager_approve_channel_cb (EmpathyDispatcher *dispatcher,
       event_manager_add (manager, contact, EMPATHY_IMAGE_DOCUMENT_SEND,
         msg, approval, event_channel_process_func, NULL);
 
-      g_object_unref (channel);
       g_object_unref (factory);
       g_object_unref (account);
     }
@@ -461,7 +459,6 @@ event_manager_approve_channel_cb (EmpathyDispatcher *dispatcher,
         EMPATHY_CONTACT_READY_NAME, event_manager_tube_got_contact_name_cb,
         approval);
 
-      g_object_unref (channel);
       g_object_unref (factory);
       g_object_unref (account);
     }
index 31775a6d330514a22ce10f5f922417073a11e9aa..0392b118ddaf5e895d8581550581d12f11fda927 100644 (file)
@@ -161,8 +161,6 @@ empathy_tube_dispatch_constructed (GObject *object)
   tp_cli_dbus_daemon_call_name_has_owner (priv->dbus, -1, priv->bus_name,
     empathy_tube_dispatch_name_has_owner_cb, NULL, NULL, G_OBJECT (self));
 
-
-  g_object_unref (channel);
   return;
 
 failed:
@@ -359,7 +357,6 @@ empathy_tube_do_dispatch (EmpathyTubeDispatch *self)
 
   channel = empathy_dispatch_operation_get_channel (priv->operation);
 
-
   /* Create the proxy for the tube handler */
   thandler = g_object_new (TP_TYPE_PROXY,
     "dbus-connection", tp_get_bus (),
@@ -382,7 +379,6 @@ empathy_tube_do_dispatch (EmpathyTubeDispatch *self)
     object_path, handle_type, handle,
     empathy_tube_dispatch_handle_tube_cb, NULL, NULL, G_OBJECT (self));
 
-  g_object_unref (channel);
   g_object_unref (thandler);
   g_object_unref (connection);
   g_free (object_path);
@@ -416,7 +412,6 @@ empathy_tube_dispatch_handle (EmpathyTubeDispatch *tube_dispatch)
       g_free (msg);
 
       tp_cli_channel_call_close (channel, -1, NULL, NULL, NULL, NULL);
-      g_object_unref (channel);
 
       goto done;
     }
index 5da2b25296fc66674c9b4fa9a963b4c1eae6dc8c..15e233d24b8799a5be34bbf1fa5985a208e0b52b 100644 (file)
@@ -102,7 +102,6 @@ dispatch_cb (EmpathyDispatcher *dispatcher,
                }
 
                empathy_chat_window_present_chat (chat);
-               g_object_unref (tp_chat);
 
                empathy_dispatch_operation_claim (operation);
        } else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA) {
@@ -114,11 +113,7 @@ dispatch_cb (EmpathyDispatcher *dispatcher,
                empathy_dispatch_operation_claim (operation);
 
                empathy_call_window_new (call);
-
-               g_object_unref (call);
-
-       }
-       else if (channel_type == EMP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER) {
+       } else if (channel_type == EMP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER) {
                EmpathyFTManager *ft_manager;
                EmpathyTpFile    *tp_file;
 
@@ -126,7 +121,6 @@ dispatch_cb (EmpathyDispatcher *dispatcher,
                tp_file = EMPATHY_TP_FILE (
                        empathy_dispatch_operation_get_channel_wrapper (operation));
                empathy_ft_manager_add_tp_file (ft_manager, tp_file);
-               g_object_unref (tp_file);
                empathy_dispatch_operation_claim (operation);
        }
 }