Re: [gtk-list] Segmentation Fault on gtk_tree_item_remove_subtree



Hi,
As I'm working on a filemanager i had this problem too, I think the problem is
in your code because I have corrected this now and all goes well. You should
mail us the part of your code where you delete tree items and we'll help you
find the bug ;)

Xavier

E3769835@pfc.eupvg.upc.es wrote:

> Hi
>
> I am using the gtk_tree and gtk_tree_item to build a tree hierarchy
> of a filesystem that can change in runtime (remove end add
> catalog-trees).
> My problem concerns when  I am using the gtk_tree_item_remove_subtree
> function when  I collapsing my TreeItems, I get segmentation fault in
> certain scenarios.
>
> Condition for segmentation fault are this structure of expanded
> directories
>
> more direcories
>       |
>      [-]----Dir 1
>       |     |
>       |    [-]-----Dir 2
> more           |
> direct-        [-]-----Dir 3
> ories            |     |
>                     |   [-] Directories under Dir 3
>                   [-]-----Dir 4
>                   |     |
>                   |   [-] Directories under Dir 4
>                   |
>            more dirextoies etc
>
> Scenario 1
>
> When I select a directory of Dir3, Dir4  etc or some  Directory under
> Dir3, Dir4 etc and then collaps Dir 1  I get segmentation fault
>
> Scenario 2
>
> I have Selected a directory  under Dir 3   and then collaps  Dir 2
> same thing happens, I get Segmentation Fault
> If I select some directory under Dir 4 everything works fine,
> It is alwawys the first directory that gives the segmentation fault
> in this scenario.
>
> When I checked with  gdb, it  reported  that the program
> crashed in gtktreeitem.c in line 632, the line looks like this
>
> ---- if(g_list_last(tree->children)->data!=item)-----
>
> The tree exists, but tree->children points at 0x0
>
> I have checked my code over and over  and I canīt  discover
> any logical errors on my behalf, but since I am simple novice in GTK
> I would really like some help on this one because I am STUCK.
>
>    Many thanks
>      Johan,  Sweden
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



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