aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-04-27 18:07:07 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-09 19:34:56 +0800
commit652f53c7969e0df0ce9c1fa9b01fb2993f270121 (patch)
treecb1f252841ffe2796083c386c5431552614654e4 /libempathy-gtk
parent6c7d3bb978f03da13cfc6dbef4d4a5b034283ce1 (diff)
downloadgsoc2013-empathy-652f53c7969e0df0ce9c1fa9b01fb2993f270121.tar
gsoc2013-empathy-652f53c7969e0df0ce9c1fa9b01fb2993f270121.tar.gz
gsoc2013-empathy-652f53c7969e0df0ce9c1fa9b01fb2993f270121.tar.bz2
gsoc2013-empathy-652f53c7969e0df0ce9c1fa9b01fb2993f270121.tar.lz
gsoc2013-empathy-652f53c7969e0df0ce9c1fa9b01fb2993f270121.tar.xz
gsoc2013-empathy-652f53c7969e0df0ce9c1fa9b01fb2993f270121.tar.zst
gsoc2013-empathy-652f53c7969e0df0ce9c1fa9b01fb2993f270121.zip
Use a for instead of a do while to avoid returning early
So we always free the stuff at the end of the function.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-log-window.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 516881825..b6531ff48 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -1892,15 +1892,15 @@ log_window_chats_set_selected (EmpathyLogWindow *window)
GtkTreeSelection *selection;
GtkTreeIter iter;
GtkTreePath *path;
+ gboolean next;
view = GTK_TREE_VIEW (window->treeview_who);
model = gtk_tree_view_get_model (view);
selection = gtk_tree_view_get_selection (view);
- if (!gtk_tree_model_get_iter_first (model, &iter))
- return;
-
- do
+ for (next = gtk_tree_model_get_iter_first (model, &iter);
+ next;
+ next = gtk_tree_model_iter_next (model, &iter))
{
TpAccount *this_account;
TplEntity *this_target;
@@ -1932,7 +1932,6 @@ log_window_chats_set_selected (EmpathyLogWindow *window)
g_object_unref (this_account);
g_object_unref (this_target);
}
- while (gtk_tree_model_iter_next (model, &iter));
tp_clear_object (&window->selected_account);
tp_clear_pointer (&window->selected_chat_id, g_free);