]> git.0d.be Git - empathy.git/commitdiff
libempathy: Fix several memory leaks from libgee
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Fri, 18 Oct 2013 13:26:43 +0000 (14:26 +0100)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Tue, 22 Oct 2013 09:40:50 +0000 (10:40 +0100)
See commit 039dc326208e02b687e93739434e27a867f4ffa7.

https://bugzilla.gnome.org/show_bug.cgi?id=710453

libempathy/empathy-individual-manager.c
libempathy/empathy-utils.c

index b3797c3b69b8fbf53b1492f9ee7ec5275560da9d..c56f6bb168d5e64b94712c35fc66d7cfdde1b66f 100644 (file)
@@ -394,7 +394,7 @@ aggregator_individuals_changed_cb (FolksIndividualAggregator *aggregator,
 
       /* Make sure we handle each added individual only once. */
       if (ind == NULL || g_list_find (added_set, ind) != NULL)
-        continue;
+        goto while_next;
       added_set = g_list_prepend (added_set, ind);
 
       g_signal_connect (ind, "notify::personas",
@@ -406,6 +406,7 @@ aggregator_individuals_changed_cb (FolksIndividualAggregator *aggregator,
           added_filtered = g_list_prepend (added_filtered, ind);
         }
 
+while_next:
       g_clear_object (&ind);
     }
   g_clear_object (&iter);
@@ -829,19 +830,21 @@ empathy_individual_manager_set_blocked (EmpathyIndividualManager *self,
 
           tp_contact = tpf_persona_get_contact (persona);
           if (tp_contact == NULL)
-            continue;
+            goto while_next;
 
           conn = tp_contact_get_connection (tp_contact);
 
           if (!tp_proxy_has_interface_by_id (conn,
                 TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_BLOCKING))
-            continue;
+            goto while_next;
 
           if (blocked)
             tp_contact_block_async (tp_contact, abusive, NULL, NULL);
           else
             tp_contact_unblock_async (tp_contact, NULL, NULL);
         }
+
+while_next:
       g_clear_object (&persona);
     }
   g_clear_object (&iter);
index 49a90f3b66b3c8f7a03f4dc38f244dc61353a5d8..4555d414493a53b49d302229fbc14bb84167a4dc 100644 (file)
@@ -560,7 +560,9 @@ empathy_dup_persona_store_for_connection (TpConnection *connection)
           account = tpf_persona_store_get_account (persona_store);
           conn_cur = tp_account_get_connection (account);
           if (conn_cur == connection)
-            result = persona_store;
+            result = g_object_ref (persona_store);
+
+          g_clear_object (&persona_store);
         }
       g_clear_object (&iter);
     }