diff --git a/LEGO1/legoobjectfactory.cpp b/LEGO1/legoobjectfactory.cpp index c5747482..222569ea 100644 --- a/LEGO1/legoobjectfactory.cpp +++ b/LEGO1/legoobjectfactory.cpp @@ -29,7 +29,7 @@ MxCore *LegoObjectFactory::Create(const char *p_name) } // OFFSET: LEGO1 0x1000fb30 STUB -void LegoObjectFactory::Destroy(void *p_object) +void LegoObjectFactory::Destroy(MxCore *p_object) { // TODO } diff --git a/LEGO1/legoobjectfactory.h b/LEGO1/legoobjectfactory.h index d01a1196..f21e6053 100644 --- a/LEGO1/legoobjectfactory.h +++ b/LEGO1/legoobjectfactory.h @@ -12,7 +12,7 @@ class LegoObjectFactory : public MxObjectFactory public: LegoObjectFactory(); virtual MxCore *Create(const char *p_name) override; // vtable 0x14 - virtual void Destroy(void *p_object) override; // vtable 0x18 + virtual void Destroy(MxCore *p_object) override; // vtable 0x18 private: #define X(V) MxAtomId m_id##V; FOR_LEGOOBJECTFACTORY_OBJECTS(X) diff --git a/LEGO1/mxobjectfactory.cpp b/LEGO1/mxobjectfactory.cpp index 78615f55..e4880411 100644 --- a/LEGO1/mxobjectfactory.cpp +++ b/LEGO1/mxobjectfactory.cpp @@ -29,17 +29,19 @@ MxObjectFactory::MxObjectFactory() MxCore *MxObjectFactory::Create(const char *p_name) { MxAtomId atom(p_name, LookupMode_Exact); + MxCore* object = NULL; - if (0) { -#define X(V) } else if (this->m_id##V == atom) { return new V; + if (0) {} +#define X(V) else if (this->m_id##V == atom) { object = new V; } FOR_MXOBJECTFACTORY_OBJECTS(X) #undef X - } else { - return NULL; - } + else {} + + return object; } -// OFFSET: LEGO1 0x100b1a30 STUB -void MxObjectFactory::Destroy(void *p_object) { - // FIXME +// OFFSET: LEGO1 0x100b1a30 +void MxObjectFactory::Destroy(MxCore *p_object) +{ + delete p_object; } diff --git a/LEGO1/mxobjectfactory.h b/LEGO1/mxobjectfactory.h index b7e0be07..078761f4 100644 --- a/LEGO1/mxobjectfactory.h +++ b/LEGO1/mxobjectfactory.h @@ -38,7 +38,7 @@ class MxObjectFactory : public MxCore } virtual MxCore *Create(const char *p_name); // vtable 0x14 - virtual void Destroy(void *p_object); // vtable 0x18 + virtual void Destroy(MxCore *p_object); // vtable 0x18 private: #define X(V) MxAtomId m_id##V; FOR_MXOBJECTFACTORY_OBJECTS(X)