[gthumb] selections: avoid possible deadlocks



commit 21fc644eff98cc05ce8419a55bab249e433f39ce
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Jul 14 13:06:24 2013 +0200

    selections: avoid possible deadlocks
    
    unlock the mutex before emitting the signals

 extensions/selections/gth-selections-manager.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/extensions/selections/gth-selections-manager.c b/extensions/selections/gth-selections-manager.c
index 7e101fa..3d7186f 100644
--- a/extensions/selections/gth-selections-manager.c
+++ b/extensions/selections/gth-selections-manager.c
@@ -391,14 +391,14 @@ gth_selections_manager_add_files (GFile *folder,
        else
                self->priv->files[n_selection - 1] = g_list_concat (self->priv->files[n_selection - 1], 
new_list);
 
+       g_mutex_unlock (&self->priv->mutex);
+
        gth_monitor_emblems_changed (gth_main_get_default_monitor (), file_list);
        gth_monitor_folder_changed (gth_main_get_default_monitor (),
                                    folder,
                                    file_list,
                                    GTH_MONITOR_EVENT_CREATED);
 
-       g_mutex_unlock (&self->priv->mutex);
-
        return TRUE;
 }
 
@@ -442,13 +442,13 @@ gth_selections_manager_remove_files (GFile *folder,
        _g_object_list_unref (self->priv->files[n_selection - 1]);
        self->priv->files[n_selection - 1] = new_list;
 
+       g_mutex_unlock (&self->priv->mutex);
+
        gth_monitor_folder_changed (gth_main_get_default_monitor (),
                                    folder,
                                    file_list,
                                    GTH_MONITOR_EVENT_REMOVED);
        gth_monitor_emblems_changed (gth_main_get_default_monitor (), file_list);
-
-       g_mutex_unlock (&self->priv->mutex);
 }
 
 


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