From 661533043047426c3bf51b02cd6b0c4944fbdc4b Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 8 Oct 2016 16:41:17 +0200 Subject: [PATCH] Fix use of UnrefQueue in removeObject --- apps/openmw/mwrender/objects.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwrender/objects.cpp b/apps/openmw/mwrender/objects.cpp index 2408d1ba0..b9ed4fb98 100644 --- a/apps/openmw/mwrender/objects.cpp +++ b/apps/openmw/mwrender/objects.cpp @@ -112,12 +112,12 @@ bool Objects::removeObject (const MWWorld::Ptr& ptr) PtrAnimationMap::iterator iter = mObjects.find(ptr); if(iter != mObjects.end()) { + if (mUnrefQueue.get()) + mUnrefQueue->push(iter->second->getObjectRoot()); + delete iter->second; mObjects.erase(iter); - if (mUnrefQueue.get()) - mUnrefQueue->push(ptr.getRefData().getBaseNode()); - ptr.getRefData().getBaseNode()->getParent(0)->removeChild(ptr.getRefData().getBaseNode()); ptr.getRefData().setBaseNode(NULL);