[gtk+/native-layout] Fix error case in filesystem model



commit 80efec2a8ca4c17bde8a04bd65f776fd6119db2a
Author: Benjamin Otte <otte redhat com>
Date:   Mon Mar 29 16:26:14 2010 +0200

    Fix error case in filesystem model
    
    We should not unref the model here, it might not even exist anymore.
    Instead check if it exists and only use it if it does.
    The unref was leftover from a previous fix in
    ba9f53397ff0b86ad56166c7fc91b4d499f7aefc.
    
    Spotted by Matthias Clasen in
    https://bugzilla.gnome.org/show_bug.cgi?id=614099

 gtk/gtkfilesystemmodel.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index 5449d30..b3328e0 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -1199,9 +1199,11 @@ gtk_file_system_model_got_enumerator (GObject *dir, GAsyncResult *res, gpointer
   enumerator = g_file_enumerate_children_finish (G_FILE (dir), res, &error);
   if (enumerator == NULL)
     {
-      g_signal_emit (model, file_system_model_signals[FINISHED_LOADING], 0, error);
-      g_object_unref (model);
-      g_error_free (error);
+      if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+      {
+        g_signal_emit (model, file_system_model_signals[FINISHED_LOADING], 0, error);
+        g_error_free (error);
+      }
     }
   else
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]