[empathy] Don't leak references to the contacts returned from empathy_contact_dup_from_folks_individual().
- From: Travis Reitter <treitter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Don't leak references to the contacts returned from empathy_contact_dup_from_folks_individual().
- Date: Tue, 20 Jul 2010 23:24:18 +0000 (UTC)
commit a4421e0ebac291f3cb897f1ea0ff2839ec50d014
Author: Travis Reitter <treitter gmail com>
Date: Thu Jul 8 11:46:00 2010 -0700
Don't leak references to the contacts returned from empathy_contact_dup_from_folks_individual().
libempathy-gtk/empathy-individual-dialogs.c | 3 +++
libempathy-gtk/empathy-individual-menu.c | 6 ++++++
libempathy-gtk/empathy-individual-store.c | 4 ++++
libempathy-gtk/empathy-individual-view.c | 3 ++-
4 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-dialogs.c b/libempathy-gtk/empathy-individual-dialogs.c
index b9a843c..b365678 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 380d0ac..be5895a 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 2153d1a..e8df839 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 a8b294c..d6aec82 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]