Hi there,

I have a possible bug fix for this :
http://sourceforge.net/tracker/?func=detail&aid=3466416&group_id=156956&atid=801864 <http://sourceforge.net/tracker/?func=detail&aid=3466416&group_id=156956&atid=801864>

To reproduce the crash, open PCManFm, select the TreeView, that's important, it doesn't segfault in the default view.
Then, change the icon theme, when you set the new theme it crashes.

Here's the changes I've done :
@@ -88,7 +88,7 @@ static void item_reload_icon(FmDirTreeMo
         for(l = item->children; l; l=l->next)
         {
             child = (FmDirTreeItem*)l->data;
-            item_reload_icon(model, l, tp);
+            item_reload_icon(model, child, tp);
             gtk_tree_path_next(tp);
         }
         gtk_tree_path_up(tp);
@@ -177,7 +177,7 @@ static void on_theme_changed(GtkIconThem
     GtkTreePath* tp = gtk_tree_path_new_first();
     for(l = model->roots; l; l=l->next)
     {
-        item_reload_icon(model, l, tp);
+        item_reload_icon(model, l->data, tp);
         gtk_tree_path_next(tp);
     }
     gtk_tree_path_free(tp);

Item_reload_icon is a recursive function, it seems to crash in the second call line 80, in :
g_object_unref(item->icon);

There's also a compiler warning about line 180.

I'm not sure if these changes are correct, I'm not an expert but that works. :D

Can someone check this in the attached patch and merge if it's correct.

Regards.

--
Axel FILMORE

diff -rup libfm/src/gtk/fm-dir-tree-model.c 01-libfm/src/gtk/fm-dir-tree-model.c
--- libfm/src/gtk/fm-dir-tree-model.c	2012-01-25 10:03:09.487929009 +0100
+++ 01-libfm/src/gtk/fm-dir-tree-model.c	2012-01-25 10:06:04.001892067 +0100
@@ -88,7 +88,7 @@ static void item_reload_icon(FmDirTreeMo
         for(l = item->children; l; l=l->next)
         {
             child = (FmDirTreeItem*)l->data;
-            item_reload_icon(model, l, tp);
+            item_reload_icon(model, child, tp);
             gtk_tree_path_next(tp);
         }
         gtk_tree_path_up(tp);
@@ -177,7 +177,7 @@ static void on_theme_changed(GtkIconThem
     GtkTreePath* tp = gtk_tree_path_new_first();
     for(l = model->roots; l; l=l->next)
     {
-        item_reload_icon(model, l, tp);
+        item_reload_icon(model, l->data, tp);
         gtk_tree_path_next(tp);
     }
     gtk_tree_path_free(tp);

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Pcmanfm-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pcmanfm-develop

Reply via email to