diff --git a/BBGE/RenderObject.cpp b/BBGE/RenderObject.cpp index 79960c1..7361adc 100644 --- a/BBGE/RenderObject.cpp +++ b/BBGE/RenderObject.cpp @@ -967,6 +967,10 @@ void RenderObject::enqueueChildDeletion(RenderObject *r) { if (r->parent == this) { + // Don't garbage a child more than once + for (size_t i = 0; i < childGarbage.size(); ++i) + if(childGarbage[i] == r) + return; childGarbage.push_back(r); } } diff --git a/BBGE/SkeletalSprite.cpp b/BBGE/SkeletalSprite.cpp index ce39dcb..d878678 100644 --- a/BBGE/SkeletalSprite.cpp +++ b/BBGE/SkeletalSprite.cpp @@ -1105,7 +1105,6 @@ void SkeletalSprite::deleteBones() { (*it)->safeKill(); } - bones.clear(); } Animation *SkeletalSprite::getAnimation(const std::string& anim)