[Xfce4-commits] <xfburn:master> Copy tree path for thread because it will get freed in the main thread immediately

David Mohr noreply at xfce.org
Sat Sep 26 07:18:03 CEST 2009


Updating branch refs/heads/master
         to ca123e1f58f4a67b6d5c64a0bbd34bea9ccf6508 (commit)
       from bd307af4667300f014cf223423a4007a889a11f1 (commit)

commit ca123e1f58f4a67b6d5c64a0bbd34bea9ccf6508
Author: David Mohr <squisher at xfce.org>
Date:   Fri Sep 25 23:14:02 2009 -0600

    Copy tree path for thread because it will get freed in the main thread immediately

 xfburn/xfburn-audio-composition.c |    2 +-
 xfburn/xfburn-data-composition.c  |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/xfburn/xfburn-audio-composition.c b/xfburn/xfburn-audio-composition.c
index b7e306f..34edf8b 100644
--- a/xfburn/xfburn-audio-composition.c
+++ b/xfburn/xfburn-audio-composition.c
@@ -987,7 +987,7 @@ action_add_selected_files (GtkAction *action, XfburnAudioComposition *dc)
     params->model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
     
     if (selected_paths) {
-      priv->path_where_insert = (GtkTreePath *) (selected_paths->data);
+      priv->path_where_insert = gtk_tree_path_copy ((GtkTreePath *) (selected_paths->data));
 
       gtk_tree_model_get_iter (params->model, &params->iter_where_insert, priv->path_where_insert);
       gtk_tree_model_get (params->model, &params->iter_where_insert, AUDIO_COMPOSITION_COLUMN_TYPE, &params->type, -1);
diff --git a/xfburn/xfburn-data-composition.c b/xfburn/xfburn-data-composition.c
index ea31735..b4f1477 100644
--- a/xfburn/xfburn-data-composition.c
+++ b/xfburn/xfburn-data-composition.c
@@ -928,7 +928,7 @@ action_add_selected_files (GtkAction *action, XfburnDataComposition *dc)
     params->model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
     
     if (selected_paths) {
-      priv->path_where_insert = (GtkTreePath *) (selected_paths->data);
+      priv->path_where_insert = gtk_tree_path_copy ((GtkTreePath *) (selected_paths->data));
 
       gtk_tree_model_get_iter (params->model, &params->iter_where_insert, priv->path_where_insert);
       gtk_tree_model_get (params->model, &params->iter_where_insert, DATA_COMPOSITION_COLUMN_TYPE, &params->type, -1);
@@ -1315,7 +1315,7 @@ thread_add_files_action (ThreadAddFilesActionParams *params)
 
   files = g_strsplit (priv->selected_files, "\n", -1);
 
-  if (!files)
+  if (files)
     for (i=0; files[i] != NULL; i++) {
       GtkTreeIter iter;
       gchar *full_path = NULL;
@@ -1711,6 +1711,7 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
       g_free (full_paths);
 
       priv->full_paths_to_add = g_list_reverse (priv->full_paths_to_add);
+      /* FIXME: path_where_insert is always NULL here */
       priv->path_where_insert = path_where_insert;
 
       params = g_new (ThreadAddFilesDragParams, 1);
@@ -1750,6 +1751,7 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
       thunar_vfs_path_list_free (vfs_paths);
 
       priv->full_paths_to_add = g_list_reverse (priv->full_paths_to_add);
+      /* FIXME: path_where_insert is always NULL here */
       priv->path_where_insert = path_where_insert;
 
       params = g_new (ThreadAddFilesDragParams, 1);



More information about the Xfce4-commits mailing list