MxEventPresenter destructor (#223)

* MxEventPresenter destructor

* Fix and implement Destroy

* Fix scope of Destroy decl

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Joshua Peisach 2023-10-20 14:41:23 -04:00 committed by GitHub
parent 3a21834382
commit 4f201eaa48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 4 deletions

View file

@ -1,4 +1,6 @@
#include "mxeventpresenter.h"
#include "mxeventmanager.h"
#include "mxomni.h"
#include "decomp.h"
@ -10,14 +12,31 @@ MxEventPresenter::MxEventPresenter()
Init();
}
// OFFSET: LEGO1 0x100c2d40 STUB
// OFFSET: LEGO1 0x100c2d40
MxEventPresenter::~MxEventPresenter()
{
// TODO
Destroy();
}
// OFFSET: LEGO1 0x100c2da0
void MxEventPresenter::Init()
{
m_unk50 = 0;
m_unk50 = NULL;
}
// OFFSET: LEGO1 0x100c2de0
void MxEventPresenter::Destroy()
{
MxEventManager *eventManager = EventManager();
if (eventManager)
EventManager()->RemovePresenter(*this);
m_criticalSection.Enter();
if (m_unk50)
delete m_unk50;
Init();
m_criticalSection.Leave();
}

View file

@ -26,10 +26,12 @@ class MxEventPresenter : public MxMediaPresenter
return !strcmp(name, MxEventPresenter::ClassName()) || MxMediaPresenter::IsA(name);
}
virtual void Destroy() override; // vtable+0x38
private:
void Init();
undefined4 m_unk50;
undefined4 *m_unk50;
};
#endif // MXEVENTPRESENTER_H