]> git.0d.be Git - empathy.git/commitdiff
Fix some referencing bugs with the IndividualStore and IndividualView
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Thu, 1 Jul 2010 13:26:04 +0000 (14:26 +0100)
committerTravis Reitter <treitter@gmail.com>
Tue, 20 Jul 2010 23:12:36 +0000 (16:12 -0700)
libempathy-gtk/empathy-individual-store.c
libempathy-gtk/empathy-individual-view.c

index a75ec3a8a729d57de0a6ecbbeaaf3a713e33c805..0f607c59dfd07863d6da6b08190858b1f6e94667 100644 (file)
@@ -925,8 +925,6 @@ individual_store_dispose (GObject *object)
     {
       g_signal_handlers_disconnect_by_func (l->data,
           G_CALLBACK (individual_store_contact_updated_cb), object);
     {
       g_signal_handlers_disconnect_by_func (l->data,
           G_CALLBACK (individual_store_contact_updated_cb), object);
-
-      g_object_unref (l->data);
     }
   g_list_free (contacts);
 
     }
   g_list_free (contacts);
 
@@ -1455,8 +1453,6 @@ empathy_individual_store_set_show_offline (EmpathyIndividualStore *self,
   for (l = contacts; l; l = l->next)
     {
       individual_store_contact_update (self, l->data);
   for (l = contacts; l; l = l->next)
     {
       individual_store_contact_update (self, l->data);
-
-      g_object_unref (l->data);
     }
   g_list_free (contacts);
 
     }
   g_list_free (contacts);
 
@@ -1512,6 +1508,8 @@ individual_store_update_list_mode_foreach (GtkTreeModel *model,
       EMPATHY_INDIVIDUAL_STORE_COL_PIXBUF_AVATAR_VISIBLE, show_avatar,
       EMPATHY_INDIVIDUAL_STORE_COL_COMPACT, priv->is_compact, -1);
 
       EMPATHY_INDIVIDUAL_STORE_COL_PIXBUF_AVATAR_VISIBLE, show_avatar,
       EMPATHY_INDIVIDUAL_STORE_COL_COMPACT, priv->is_compact, -1);
 
+  g_object_unref (individual);
+
   return FALSE;
 }
 
   return FALSE;
 }
 
@@ -1616,7 +1614,6 @@ empathy_individual_store_set_show_groups (EmpathyIndividualStore *self,
       individual_store_members_changed_cb (priv->manager,
           "re-adding members: toggled group visibility",
           contacts, NULL, 0, self);
       individual_store_members_changed_cb (priv->manager,
           "re-adding members: toggled group visibility",
           contacts, NULL, 0, self);
-      g_list_foreach (contacts, (GFunc) g_free, NULL);
       g_list_free (contacts);
     }
 
       g_list_free (contacts);
     }
 
index 5c8e96b80f2369140e730085a9dfb8bf2f70e881..e75f3629ee817f5f1d0fb6441d3fbba65620a311 100644 (file)
@@ -295,12 +295,12 @@ individual_view_query_tooltip_cb (EmpathyIndividualView *view,
     {
       goto OUT;
     }
     {
       goto OUT;
     }
-  else
-    {
-      contact = empathy_contact_from_folks_individual (individual);
-      if (contact == NULL)
-        goto OUT;
-    }
+
+  contact = empathy_contact_from_folks_individual (individual);
+  g_object_unref (individual);
+
+  if (contact == NULL)
+    goto OUT;
 
   if (!priv->tooltip_widget)
     {
 
   if (!priv->tooltip_widget)
     {
@@ -322,7 +322,6 @@ individual_view_query_tooltip_cb (EmpathyIndividualView *view,
   ret = TRUE;
 
   g_object_unref (contact);
   ret = TRUE;
 
   g_object_unref (contact);
-  g_object_unref (individual);
 OUT:
   running--;
 
 OUT:
   running--;
 
@@ -648,7 +647,6 @@ individual_view_drag_motion (GtkWidget *widget,
           gdk_drag_status (context, GDK_ACTION_COPY, time_);
           gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget),
               path, GTK_TREE_VIEW_DROP_INTO_OR_BEFORE);
           gdk_drag_status (context, GDK_ACTION_COPY, time_);
           gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget),
               path, GTK_TREE_VIEW_DROP_INTO_OR_BEFORE);
-          g_object_unref (individual);
         }
       else
         {
         }
       else
         {
@@ -656,6 +654,9 @@ individual_view_drag_motion (GtkWidget *widget,
           gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget), NULL, 0);
           retval = FALSE;
         }
           gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget), NULL, 0);
           retval = FALSE;
         }
+
+      if (individual != NULL)
+        g_object_unref (individual);
     }
 
   if (!is_different && !cleanup)
     }
 
   if (!is_different && !cleanup)
@@ -768,6 +769,8 @@ individual_view_drag_data_get (GtkWidget *widget,
           (guchar *) individual_id, strlen (individual_id) + 1);
       break;
     }
           (guchar *) individual_id, strlen (individual_id) + 1);
       break;
     }
+
+  g_object_unref (individual);
 }
 
 static void
 }
 
 static void