aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTravis Reitter <treitter@gmail.com>2010-07-10 04:54:16 +0800
committerTravis Reitter <treitter@gmail.com>2010-07-21 07:12:37 +0800
commit22c93bf49f6a3fdf31496d2c2fd7b7553ee351f1 (patch)
treeb1699b5849e1b7a7d28bbb422667aa569ca0e0e8
parentd392ae0a2fd82c9ae39a0f9594f7cdd8ed3b4411 (diff)
downloadgsoc2013-empathy-22c93bf49f6a3fdf31496d2c2fd7b7553ee351f1.tar
gsoc2013-empathy-22c93bf49f6a3fdf31496d2c2fd7b7553ee351f1.tar.gz
gsoc2013-empathy-22c93bf49f6a3fdf31496d2c2fd7b7553ee351f1.tar.bz2
gsoc2013-empathy-22c93bf49f6a3fdf31496d2c2fd7b7553ee351f1.tar.lz
gsoc2013-empathy-22c93bf49f6a3fdf31496d2c2fd7b7553ee351f1.tar.xz
gsoc2013-empathy-22c93bf49f6a3fdf31496d2c2fd7b7553ee351f1.tar.zst
gsoc2013-empathy-22c93bf49f6a3fdf31496d2c2fd7b7553ee351f1.zip
Take advantage of tp_clear_object().
-rw-r--r--libempathy-gtk/empathy-individual-menu.c3
-rw-r--r--src/empathy-main-window.c11
2 files changed, 5 insertions, 9 deletions
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index be5895ac5..a3cacdaae 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -232,8 +232,7 @@ empathy_individual_add_menu_item_new (FolksIndividual *individual)
individual);
out:
- if (contact != NULL)
- g_object_unref (contact);
+ tp_clear_object (&contact);
return item;
}
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 4c60c87a1..be3ca5498 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -30,6 +30,7 @@
#include <glib/gi18n.h>
#include <telepathy-glib/account-manager.h>
+#include <telepathy-glib/util.h>
#include <folks/folks.h>
#include <libempathy/empathy-contact.h>
@@ -189,9 +190,7 @@ main_window_flash_foreach (GtkTreeModel *model,
contact = empathy_contact_dup_from_folks_individual (individual);
if (contact != data->event->contact) {
- if (contact != NULL) {
- g_object_unref (contact);
- }
+ tp_clear_object (&contact);
return FALSE;
}
@@ -221,8 +220,7 @@ main_window_flash_foreach (GtkTreeModel *model,
}
g_object_unref (individual);
- if (contact != NULL)
- g_object_unref (contact);
+ tp_clear_object (&contact);
return FALSE;
}
@@ -355,8 +353,7 @@ main_window_row_activated_cb (EmpathyContactListView *view,
g_object_unref (contact);
OUT:
- if (individual != NULL)
- g_object_unref (individual);
+ tp_clear_object (&individual);
}
static void