Display::~Display(){ for (LinkedList* i = _instances; i != NULL; i = i->next){ if (i->data == this){ // if removing the first element, manually set _instances to the next node if (i == _instances){ _instances = _instances->next; } linkedlistRemove(i); return; } } // ERROR sassert(false, "Display* not found"); }
void EntityManager::Remove(Entity* entity) { for(LinkedList* node = mEntities; node != NULL; node = node->next) { Entity* current = (Entity*) node->data; if(current == entity) { mNumEntities--; delete current; linkedlistRemove(node); return; } } }