wmlanza

GraphicTracker Items no longer in collection

Discussion created by wmlanza on Oct 6, 2011
I am running into a problem where graphictracker items are being removed from the graphictracker collection without me specifically removing them, causing a Memory Access Violation exception and crashing my app.

I maintain a collection of IDs, call it "MyIDCollection", that are added to and removed in conjunction with adding and removing items from the GT collection.  I make sure that the id is removed from MyIDCollection BEFORE I remove the item from the GT collection. And I make sure the item is added to the GTCollection before adding it to MyIDCollection, thus keeping the 2 collections in sync. I wish the GT class had a "Contains" method.

But occasionally when I call graphictracker.remove(id) I get either a 'Value not contained in collection' exception or a Memory Access Violation exception.

Has anyone seen this behavior before?

Outcomes