[gnome-commander/gcmd-1-3] Fixed problem #375357 (crash when cancelling calculation of dir properties)



commit 8436306d9a926903504752e730f755f63368b91a
Author: Dmitriy Lyfar <dlyfar gmail com>
Date:   Sun Jun 21 13:28:58 2009 +0200

    Fixed problem #375357 (crash when cancelling calculation of dir properties)

 ChangeLog                          |    7 ++++++-
 NEWS                               |    1 +
 src/gnome-cmd-file-props-dialog.cc |    5 ++++-
 3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d2b6ebc..fd2199e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,15 @@
+2009-06-21  Dmitriy Lyfar  <dlyfar gmail com>
+
+	* src/gnome-cmd-file-props-dialog.cc:
+	Fixed problem #375357 (crash when cancelling calculation of dir properties)
+
 2009-06-15  Piotr Eljasiak  <epiotr use pl>
 
 	* src/gnome-cmd-profile-component.cc:
 	advrename profiles: ref template_entry to keep it alive longer
 
 	* src/dialogs/gnome-cmd-manage-profile-dialog.cc:
-	advrename profiles: added supprt for profile editing
+	advrename profiles: added support for profile editing
 
 2009-06-14  Piotr Eljasiak  <epiotr use pl>
 
diff --git a/NEWS b/NEWS
index e25fc0a..fa2d0a7 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ gnome-commander 1.2.8
 ---------------
 
 Bug fixes:
+ * Fixed problem #375357 (crash when cancelling calculation of dir properties)
  * Fixed problem #536446 (file name not focused for in-place renaming)
  * Fixed problem #548947 (non-UTF8 locale date problem)
  * Fixed problem #548948 (crash when home directory contains non-UTF8 characters)
diff --git a/src/gnome-cmd-file-props-dialog.cc b/src/gnome-cmd-file-props-dialog.cc
index e3bd519..5f08e16 100644
--- a/src/gnome-cmd-file-props-dialog.cc
+++ b/src/gnome-cmd-file-props-dialog.cc
@@ -45,6 +45,7 @@ typedef struct
     GMutex *mutex;
     gboolean count_done;
     gchar *msg;
+    guint updater_proc_id;
 
     GtkWidget *notebook;
     GtkWidget *copy_button;
@@ -140,6 +141,8 @@ static void calc_tree_size_func (GnomeCmdFilePropsDialogPrivate *data)
 // Tells the thread to exit and then waits for it to do so.
 static gboolean join_thread_func (GnomeCmdFilePropsDialogPrivate *data)
 {
+    g_source_remove (data->updater_proc_id);
+    
     if (data->thread)
         g_thread_join (data->thread);
 
@@ -185,7 +188,7 @@ static void do_calc_tree_size (GnomeCmdFilePropsDialogPrivate *data)
 
     data->thread = g_thread_create ((PthreadFunc) calc_tree_size_func, data, TRUE, NULL);
 
-    g_timeout_add (gnome_cmd_data.gui_update_rate, (GSourceFunc) update_count_status, data);
+    data->updater_proc_id = g_timeout_add (gnome_cmd_data.gui_update_rate, (GSourceFunc) update_count_status, data);
 }
 
 



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