Re: ListStoreModel clear() seems to be corrupted nearby memory



On Wed, 19 Dec 2007, Josh Sinykin <jsinykin gmail com> wrote :
I also tried this code as well to erase all the rows

type_children children = PtrCoreByteSelModel[x][i]->children();
               for(type_children::iterator iter = children.begin();
                   iter != children.end();)
               {
                 iter = PtrCoreByteSelModel[x][i]->erase(iter);
                 //Do something with the row - see above for set/get.
               }

but this causes the same issue as ->clear() did.

Not wishing to seem obvious, but are you sure the problem is what you think? I notice from your original code that there _is_ a condition where the string array you think you're "losing" gets set to empty strings. Are you sure what's happening is not that your code is following that path instead?

I suggest you change the "else" clause of the "if(treeiter)" to set an arbitrary non-blank string, say "Nowt here, move along", then see whether the array still ends up blank.
--
Rob Pearce                       http://www.bdt-home.demon.co.uk

The contents of this | Windows NT crashed.
message are purely   | I am the Blue Screen of Death.
my opinion. Don't    | No one hears your screams.
believe a word.      |


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