[easytag/easytag-2-2] Fix crash when reloading the directory tree



commit 4e75b922da6bac1c60cb1f4965d4eaf2a34e8aac
Author: David King <amigadave amigadave com>
Date:   Wed Jul 30 11:58:38 2014 +0200

    Fix crash when reloading the directory tree
    
    As the directory is cleared during reloading, the selection changes and
    this leads to a crash when a directory in the tree is deleted outside of
    EasyTAG. Avoid the changed signal being emitted by clearing the
    directory tree only when the signal is blocked.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1121142

 src/browser.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/browser.c b/src/browser.c
index 4954f54..822d4b1 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -2639,12 +2639,12 @@ void Browser_Tree_Rebuild (gchar *path_to_load)
             current_path = g_strdup(DEFAULT_PATH_TO_MP3);
     }
 
-    Browser_Tree_Initialize();
     /* Select again the memorized path without loading files */
     selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(BrowserTree));
     if (selection)
     {
         g_signal_handlers_block_by_func(G_OBJECT(selection),G_CALLBACK(Browser_Tree_Node_Selected),NULL);
+        Browser_Tree_Initialize ();
         Browser_Tree_Select_Dir(current_path);
         g_signal_handlers_unblock_by_func(G_OBJECT(selection),G_CALLBACK(Browser_Tree_Node_Selected),NULL);
     }


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