Merge pull request #56 from Azaezel/alpha40_4_entityComponentCleanup

Alpha40 4 entity component cleanup
This commit is contained in:
Areloch 2019-06-29 02:43:46 -05:00 committed by GitHub
commit 747113bfc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1391,7 +1391,7 @@ void Entity::clearComponents(bool deleteComponents)
{ {
while (mComponents.size() > 0) while (mComponents.size() > 0)
{ {
Component* comp = mComponents.first(); Component* comp = mComponents.last();
if (comp) if (comp)
{ {
@ -1399,6 +1399,7 @@ void Entity::clearComponents(bool deleteComponents)
comp->deleteObject(); comp->deleteObject();
} }
mComponents.pop_back();
} }
} }
} }