fixed frame hierarchy bugs

This commit is contained in:
aap 2020-08-10 08:22:50 +02:00
parent d92996c66d
commit 0f0147272c
4 changed files with 5 additions and 2 deletions

View File

@ -345,6 +345,7 @@ Camera::destroy(void)
s_plglist.destruct(this);
assert(this->clump == nil);
assert(this->world == nil);
this->setFrame(nil);
rwFree(this);
numAllocated--;
}

View File

@ -58,7 +58,7 @@ Clump::clone(void)
atomic->setFrame(a->getFrame()->root);
clump->addAtomic(atomic);
}
root->purgeClone();
this->getFrame()->purgeClone();
// World extension
if(this->world)

View File

@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "rwbase.h"
#include "rwerror.h"
@ -51,7 +52,6 @@ Frame::cloneHierarchy(void)
this->purgeClone();
return frame;
}
void
Frame::destroy(void)
{
@ -76,6 +76,7 @@ Frame::destroyHierarchy(void)
next = child->next;
child->destroyHierarchy();
}
assert(this->objectList.isEmpty());
s_plglist.destruct(this);
if(this->object.privateFlags & Frame::HIERARCHYSYNC)
this->inDirtyList.remove();

View File

@ -69,6 +69,7 @@ Light::destroy(void)
s_plglist.destruct(this);
assert(this->clump == nil);
assert(this->world == nil);
this->setFrame(nil);
rwFree(this);
numAllocated--;
}