summaryrefslogtreecommitdiff
path: root/gtk/gtkmountoperation.c
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2009-10-20 04:08:00 +0200
committerJavier Jardón <jjardon@gnome.org>2009-10-21 02:45:05 +0200
commit69773763ee7fbd2c494a5b8c5ff13093715fb788 (patch)
treee2981896116d2a5c8a2a941a1d094a3ceef84b07 /gtk/gtkmountoperation.c
parent13ff5575872c89abb12b8b7620bfd3745aaf53a5 (diff)
downloadgtk+-69773763ee7fbd2c494a5b8c5ff13093715fb788.tar.gz
Fix a compilation warning
Reorder the function so the "lookup_context" variable can't be used uninitialized
Diffstat (limited to 'gtk/gtkmountoperation.c')
-rw-r--r--gtk/gtkmountoperation.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c
index 6137388c0b..4a1c9f8a8b 100644
--- a/gtk/gtkmountoperation.c
+++ b/gtk/gtkmountoperation.c
@@ -981,21 +981,22 @@ update_process_list_store (GtkMountOperation *mount_operation,
diff_sorted_arrays (current_pids, processes, pid_equal, pid_indices_to_add, pid_indices_to_remove);
- if (pid_indices_to_add->len > 0)
- lookup_context = _gtk_mount_operation_lookup_context_get (gtk_widget_get_display (mount_operation->priv->process_tree_view));
- for (n = 0; n < pid_indices_to_add->len; n++)
- {
- pid = g_array_index (processes, GPid, n);
- add_pid_to_process_list_store (mount_operation, lookup_context, list_store, pid);
- }
-
for (n = 0; n < pid_indices_to_remove->len; n++)
{
pid = g_array_index (current_pids, GPid, n);
remove_pid_from_process_list_store (mount_operation, list_store, pid);
}
+
if (pid_indices_to_add->len > 0)
- _gtk_mount_operation_lookup_context_free (lookup_context);
+ {
+ lookup_context = _gtk_mount_operation_lookup_context_get (gtk_widget_get_display (mount_operation->priv->process_tree_view));
+ for (n = 0; n < pid_indices_to_add->len; n++)
+ {
+ pid = g_array_index (processes, GPid, n);
+ add_pid_to_process_list_store (mount_operation, lookup_context, list_store, pid);
+ }
+ _gtk_mount_operation_lookup_context_free (lookup_context);
+ }
/* select the first item, if we went from a zero to a non-zero amount of processes */
if (current_pids->len == 0 && pid_indices_to_add->len > 0)