Finish Destroy

This commit is contained in:
Christian Semmler 2024-01-17 12:20:59 -05:00
parent 582fd88709
commit 0428af89b7
2 changed files with 17 additions and 6 deletions

View File

@ -24,6 +24,8 @@ class LegoHideAnimPresenter : public LegoLoopingAnimPresenter {
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name); return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
} }
virtual void Destroy() override; // vtable+0x38
private: private:
void Init(); void Init();
void Destroy(MxBool p_fromDestructor); void Destroy(MxBool p_fromDestructor);

View File

@ -17,18 +17,27 @@ LegoHideAnimPresenter::~LegoHideAnimPresenter()
// FUNCTION: LEGO1 0x1006da50 // FUNCTION: LEGO1 0x1006da50
void LegoHideAnimPresenter::Init() void LegoHideAnimPresenter::Init()
{ {
this->m_unk0xc0 = NULL; m_unk0xc0 = NULL;
} }
// STUB: LEGO1 0x1006da60 // FUNCTION: LEGO1 0x1006da60
void LegoHideAnimPresenter::Destroy(MxBool p_fromDestructor) void LegoHideAnimPresenter::Destroy(MxBool p_fromDestructor)
{ {
m_criticalSection.Enter(); m_criticalSection.Enter();
if (!this->m_unk0xc0)
delete this->m_unk0xc0; if (m_unk0xc0)
delete m_unk0xc0;
Init(); Init();
m_criticalSection.Leave(); m_criticalSection.Leave();
// if (!p_fromDestructor) // This appears to be a bug, since it results in an endless loop
// TODO: another function if (!p_fromDestructor)
LegoHideAnimPresenter::Destroy();
}
// FUNCTION: LEGO1 0x1006dac0
void LegoHideAnimPresenter::Destroy()
{
Destroy(FALSE);
} }