Commit da5ec3c2 authored by Travis Reitter's avatar Travis Reitter

Merge remote branch 'pwith/folks-integ-rebase1-fixes-rebase1' into folks-fixes

parent 5ee7ffd3
......@@ -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;
}
}
......
......@@ -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;
}
......
......@@ -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 &&
......
......@@ -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
......
......@@ -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
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment