diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2010-08-24 19:37:45 +0800 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2010-08-27 17:23:48 +0800 |
commit | a1aea4b698a537c046e53215d2a64259b97cd935 (patch) | |
tree | 65bb53bf7caabe517f7129569fd3438671e9e161 | |
parent | 56e80c63b33bff7d82cd43bc8e1dc02f1a10a1d4 (diff) | |
download | gsoc2013-empathy-a1aea4b698a537c046e53215d2a64259b97cd935.tar gsoc2013-empathy-a1aea4b698a537c046e53215d2a64259b97cd935.tar.gz gsoc2013-empathy-a1aea4b698a537c046e53215d2a64259b97cd935.tar.bz2 gsoc2013-empathy-a1aea4b698a537c046e53215d2a64259b97cd935.tar.lz gsoc2013-empathy-a1aea4b698a537c046e53215d2a64259b97cd935.tar.xz gsoc2013-empathy-a1aea4b698a537c046e53215d2a64259b97cd935.tar.zst gsoc2013-empathy-a1aea4b698a537c046e53215d2a64259b97cd935.zip |
Fix memory leaks in EmpathyIndividualView drop handling code
-rw-r--r-- | libempathy-gtk/empathy-individual-view.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index f86004521..926f4ddf7 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -276,13 +276,13 @@ individual_view_contact_drag_received (GtkWidget *self, GtkSelectionData *selection) { EmpathyIndividualViewPriv *priv; - EmpathyIndividualManager *manager; + EmpathyIndividualManager *manager = NULL; FolksIndividual *individual; GtkTreePath *source_path; const gchar *sel_data; gchar *new_group = NULL; gchar *old_group = NULL; - gboolean new_group_is_fake, old_group_is_fake = TRUE; + gboolean new_group_is_fake, old_group_is_fake = TRUE, retval = FALSE; priv = GET_PRIV (self); @@ -291,7 +291,7 @@ individual_view_contact_drag_received (GtkWidget *self, NULL, &new_group_is_fake); if (!group_can_be_modified (new_group, new_group_is_fake, TRUE)) - return FALSE; + goto finished; /* Get source group information. */ if (priv->drag_row) @@ -307,14 +307,10 @@ individual_view_contact_drag_received (GtkWidget *self, } if (!group_can_be_modified (old_group, old_group_is_fake, FALSE)) - return FALSE; + goto finished; if (!tp_strdiff (old_group, new_group)) - { - g_free (new_group); - g_free (old_group); - return FALSE; - } + goto finished; /* XXX: for contacts, we used to ensure the account, create the contact * factory, and then wait on the contacts. But they should already be @@ -326,10 +322,7 @@ individual_view_contact_drag_received (GtkWidget *self, if (individual == NULL) { DEBUG ("failed to find drag event individual with ID '%s'", sel_data); - - g_object_unref (manager); - - return FALSE; + goto finished; } /* FIXME: We should probably wait for the cb before calling @@ -369,11 +362,14 @@ individual_view_contact_drag_received (GtkWidget *self, } } - g_object_unref (G_OBJECT (manager)); + retval = TRUE; + +finished: + tp_clear_object (&manager); g_free (old_group); g_free (new_group); - return TRUE; + return retval; } static gboolean |