aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTravis Reitter <treitter@gmail.com>2010-07-09 02:46:00 +0800
committerTravis Reitter <treitter@gmail.com>2010-07-21 07:12:36 +0800
commita4421e0ebac291f3cb897f1ea0ff2839ec50d014 (patch)
tree6b185608dc6a197a064e6bee491eacd481b29ffc
parentfef2dec3ea6216921b297c7edbb3665e6c222ef5 (diff)
downloadgsoc2013-empathy-a4421e0ebac291f3cb897f1ea0ff2839ec50d014.tar
gsoc2013-empathy-a4421e0ebac291f3cb897f1ea0ff2839ec50d014.tar.gz
gsoc2013-empathy-a4421e0ebac291f3cb897f1ea0ff2839ec50d014.tar.bz2
gsoc2013-empathy-a4421e0ebac291f3cb897f1ea0ff2839ec50d014.tar.lz
gsoc2013-empathy-a4421e0ebac291f3cb897f1ea0ff2839ec50d014.tar.xz
gsoc2013-empathy-a4421e0ebac291f3cb897f1ea0ff2839ec50d014.tar.zst
gsoc2013-empathy-a4421e0ebac291f3cb897f1ea0ff2839ec50d014.zip
Don't leak references to the contacts returned from empathy_contact_dup_from_folks_individual().
-rw-r--r--libempathy-gtk/empathy-individual-dialogs.c3
-rw-r--r--libempathy-gtk/empathy-individual-menu.c6
-rw-r--r--libempathy-gtk/empathy-individual-store.c4
-rw-r--r--libempathy-gtk/empathy-individual-view.c3
4 files changed, 15 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-individual-dialogs.c b/libempathy-gtk/empathy-individual-dialogs.c
index b9a843c57..b36567832 100644
--- a/libempathy-gtk/empathy-individual-dialogs.c
+++ b/libempathy-gtk/empathy-individual-dialogs.c
@@ -27,6 +27,7 @@
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
+#include <telepathy-glib/util.h>
#include <folks/folks.h>
#include <libempathy/empathy-individual-manager.h>
@@ -149,4 +150,6 @@ empathy_new_individual_dialog_show_with_individual (GtkWindow *parent,
gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
gtk_widget_show (dialog);
+
+ tp_clear_object (&contact);
}
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index 380d0ac57..be5895ac5 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -378,6 +378,8 @@ individual_log_menu_item_activate_cb (FolksIndividual *individual)
empathy_log_window_show (empathy_contact_get_account (contact),
empathy_contact_get_id (contact), FALSE, NULL);
+
+ g_object_unref (contact);
}
GtkWidget *
@@ -532,6 +534,8 @@ individual_info_menu_item_activate_cb (FolksIndividual *individual)
contact = empathy_contact_dup_from_folks_individual (individual);
empathy_contact_information_dialog_show (contact, NULL);
+
+ tp_clear_object (&contact);
}
GtkWidget *
@@ -564,6 +568,8 @@ individual_edit_menu_item_activate_cb (FolksIndividual *individual)
contact = empathy_contact_dup_from_folks_individual (individual);
empathy_contact_edit_dialog_show (contact, NULL);
+
+ tp_clear_object (&contact);
}
GtkWidget *
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index 2153d1ab8..e8df8394f 100644
--- a/libempathy-gtk/empathy-individual-store.c
+++ b/libempathy-gtk/empathy-individual-store.c
@@ -430,6 +430,8 @@ individual_store_add_individual (EmpathyIndividualStore *self,
}
individual_store_contact_update (self, individual);
+
+ tp_clear_object (&contact);
}
static void
@@ -1820,6 +1822,8 @@ individual_store_get_individual_status_icon_with_icon_name (
}
g_free (icon_name);
+ tp_clear_object (&contact);
+
return pixbuf_status;
}
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index a8b294c2b..d6aec8271 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -488,6 +488,7 @@ individual_view_file_drag_received (GtkWidget *view,
empathy_send_file_from_uri_list (contact, sel_data);
g_object_unref (individual);
+ tp_clear_object (&contact);
return TRUE;
}
@@ -898,7 +899,6 @@ individual_view_row_activated (GtkTreeView *view,
return;
contact = empathy_contact_dup_from_folks_individual (individual);
-
if (contact != NULL)
{
DEBUG ("Starting a chat");
@@ -908,6 +908,7 @@ individual_view_row_activated (GtkTreeView *view,
}
g_object_unref (individual);
+ tp_clear_object (&contact);
}
static void