Re: treeview: seg fault When Collapsing a Row Containg a Selected Item




On Sat, 2007-06-16 at 12:15 -0400, Marshall Lake wrote:

I have a treeview/treestore containing many top-level rows.  Each 
top-level row contains many children.  The treeview works fine except for 
one thing.  If the user expands a top-level row, selects a child, and then 
collapses that row the program seg faults with the console error:

gtk_tree_store_get_value: assertion `iter->stamp == GTK_TREE_STORE (tree_model)->stamp' failed
gtype.c:3351: type id `0' is invalid
can't peek value table for type `<invalid>' which is not currently referenced


Without seeing the code I can only guess.  I seems that the iter your
using is invalid -- or no longer valid.  This could occur if you used a
LOCAL variable to create the iter; then saved the pointer of that inter
and tried to use it somewhere else which creates the segfault.

To poke around looking for it, use this api to test iters before use:
bool=gtk_tree_store_iter_is_valid(GtkTreeStore *tree_model, GtkTreeIter
*iter)

never trust an iter...

James,


The treeview works fine if the user never collapses the row and goes on to 
make another selection, either in that same top-level or a different 
top-level.  Also, if a row is expanded and then collapsed with no child 
being selected it works fine.

As an aside (?), I tried gtk_tree_selection_unselect_iter() on the child 
after it was selected and got a seg fault and the same error as noted 
above at the point the gtk_tree_selection_unselect_iter() was executed.

Can someone tell me what might need to be done to avoid the seg fault?




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