subtle bug - known?
Posted: Mon Apr 20, 2009 7:40 pm
If I call
and somewhere deep inside funky call
In
If the deleted object is in the same bin as another, it crashes here, as the linked list has been changed out from under the loop. Maybe it needs documenting or I missed it somewhere...
Code: Select all
cpSpaceHashEach(space->activeShapes, &funky, NULL);
Code: Select all
cpSpaceRemoveBody(space, shape->body);
cpBodyFree(shape->body);
cpSpaceRemoveShape(space, shape);
cpShapeFree(shape);
Code: Select all
cpHashSetEach(cpHashSet *set, cpHashSetIterFunc func, void *data)
{
for(int i=0; i<set->size; i++)
{
cpHashSetBin *bin;
for(bin = set->table[i]; bin; bin = bin->next)
{
func(bin->elt, data); **************
}
}
}