]> git.0d.be Git - empathy.git/commitdiff
Merge remote branch 'pwith/folks-integ-rebase1-fixes-rebase1' into folks-fixes
authorTravis Reitter <treitter@gmail.com>
Wed, 14 Jul 2010 20:55:07 +0000 (13:55 -0700)
committerTravis Reitter <treitter@gmail.com>
Wed, 21 Jul 2010 16:03:37 +0000 (09:03 -0700)
libempathy-gtk/empathy-contact-widget.c
libempathy-gtk/empathy-individual-menu.c
libempathy-gtk/empathy-individual-store.c
libempathy/empathy-individual-manager.c
po/POTFILES.in
src/empathy-main-window.c

index 92f6c4b58c156243db3b39bb2b7f276d1dca4ae1..9bdad553428f90a962237d731eafe41a0ddac8a5 100644 (file)
@@ -1460,9 +1460,9 @@ contact_widget_remove_contact (EmpathyContactWidget *information)
 
   if (information->details_cancellable != NULL)
     {
+      /* The cancellable will be unreffed and cleared in
+       * contact_widget_details_request_cb */
       g_cancellable_cancel (information->details_cancellable);
-      g_object_unref (information->details_cancellable);
-      information->details_cancellable = NULL;
     }
 }
 
index fcac824b7c37f00984520c55c27ae7cf4b084da5..72ea1b80baa5812974a03c5f91c462beacd3f5bf 100644 (file)
@@ -143,7 +143,6 @@ empathy_individual_menu_new (FolksIndividual *individual,
       gtk_widget_show (item);
     }
 
-#if HAVE_FAVOURITE_CONTACTS
   /* Favorite checkbox */
   if (features & EMPATHY_INDIVIDUAL_FEATURE_FAVOURITE)
     {
@@ -151,7 +150,6 @@ empathy_individual_menu_new (FolksIndividual *individual,
       gtk_menu_shell_append (shell, item);
       gtk_widget_show (item);
     }
-#endif
 
   return menu;
 }
@@ -175,7 +173,7 @@ empathy_individual_add_menu_item_new (FolksIndividual *individual)
 {
   GtkWidget *item;
   GtkWidget *image;
-  EmpathyIndividualManager *manager;
+  EmpathyIndividualManager *manager = NULL;
   EmpathyContact *contact = NULL;
   TpConnection *connection;
   GList *l, *members;
@@ -215,7 +213,6 @@ empathy_individual_add_menu_item_new (FolksIndividual *individual)
         }
     }
   g_list_free (members);
-  g_object_unref (manager);
 
   if (found)
     {
@@ -233,6 +230,7 @@ empathy_individual_add_menu_item_new (FolksIndividual *individual)
 
 out:
   tp_clear_object (&contact);
+  tp_clear_object (&manager);
 
   return item;
 }
index da590608a6324160cb71ace1c6ec4a704535ae2d..623e35626e74ca042c2a4cec5825228a64b5d917 100644 (file)
@@ -345,7 +345,6 @@ individual_store_add_individual (EmpathyIndividualStore *self,
   GtkTreeIter iter;
   GHashTable *group_set = NULL;
   GList *groups = NULL, *l;
-  EmpathyIndividualManager *manager;
   EmpathyContact *contact;
   TpConnection *connection;
   EmpathyIndividualManagerFlags flags = 0;
@@ -363,10 +362,9 @@ individual_store_add_individual (EmpathyIndividualStore *self,
       groups = g_hash_table_get_keys (group_set);
     }
 
-  manager = empathy_individual_manager_dup_singleton ();
   contact = empathy_contact_dup_from_folks_individual (individual);
   connection = empathy_contact_get_connection (contact);
-  flags = empathy_individual_manager_get_flags_for_connection (manager,
+  flags = empathy_individual_manager_get_flags_for_connection (priv->manager,
       connection);
 
   tp_connection_parse_object_path (connection, &protocol_name, NULL);
@@ -481,8 +479,15 @@ individual_store_contact_active_new (EmpathyIndividualStore *self,
 
   data = g_slice_new0 (ShowActiveData);
 
-  data->self = g_object_ref (self);
-  data->individual = g_object_ref (individual);
+  /* We don't actually want to force either the IndividualStore or the
+   * Individual to stay alive, since the user could quit Empathy or disable
+   * the account before the contact_active timeout is fired. */
+  g_object_add_weak_pointer (G_OBJECT (self), (gpointer) &(data->self));
+  g_object_add_weak_pointer (G_OBJECT (individual),
+      (gpointer) &(data->individual));
+
+  data->self = self;
+  data->individual = individual;
   data->remove = remove_;
 
   return data;
@@ -491,9 +496,6 @@ individual_store_contact_active_new (EmpathyIndividualStore *self,
 static void
 individual_store_contact_active_free (ShowActiveData *data)
 {
-  g_object_unref (data->individual);
-  g_object_unref (data->self);
-
   g_slice_free (ShowActiveData, data);
 }
 
@@ -502,6 +504,15 @@ individual_store_contact_active_cb (ShowActiveData *data)
 {
   EmpathyIndividualStorePriv *priv;
 
+  /* They're weak pointers, so may have been NULLified between ShowActiveData
+   * being created and the timeout being fired. We assume they can only be
+   * destroyed in this thread, so this isn't MT-safe. */
+  if (data->self == NULL || data->individual == NULL)
+    {
+      individual_store_contact_active_free (data);
+      return FALSE;
+    }
+
   priv = GET_PRIV (data->self);
 
   if (data->remove &&
index 61f61f96d4d311624899ae51436e09ea54c65eae..218dddaa6bbebbe1db3a0c3f6c4aa1c9177610f6 100644 (file)
@@ -284,6 +284,7 @@ aggregator_add_persona_from_details_cb (GObject *source,
 
   /* We can unref the contact now */
   g_object_unref (contact);
+  g_object_unref (persona);
 }
 
 void
index a89aff235ad70a17de89df5f5be3054c8a4698f7..21a67d6c99a4ec716010fac3665d4ce477d996c6 100644 (file)
@@ -66,6 +66,7 @@ src/empathy-account-assistant.c
 src/empathy-accounts-dialog.c
 [type: gettext/glade]src/empathy-accounts-dialog.ui
 src/empathy-auto-salut-account-helper.c
+src/empathy-av.c
 src/empathy-call-window.c
 [type: gettext/glade]src/empathy-call-window.ui
 src/empathy-chat-window.c
index be3ca54985c151e3cce7e16f7a434ecbd599afa0..ae50eaa4eff93ea31740bebc405d0735bbcfba56 100644 (file)
@@ -1623,6 +1623,8 @@ empathy_main_window_init (EmpathyMainWindow *window)
        individual_manager = empathy_individual_manager_dup_singleton ();
        priv->individual_store = empathy_individual_store_new (
                        individual_manager);
+       g_object_unref (individual_manager);
+
        priv->individual_view = empathy_individual_view_new (
                        priv->individual_store,
                        EMPATHY_INDIVIDUAL_VIEW_FEATURE_ALL,