Don't delete a member variable. C++ automatically destructs member variables

This commit is contained in:
Anonymous Maarten 2023-07-01 17:36:22 +02:00
parent 0b015bee3a
commit 317510f1d3
2 changed files with 8 additions and 9 deletions

View File

@ -1,14 +1,6 @@
#include "mxstringvariable.h"
#include "mxstring.h"
//FIXME: Figure out what exactly this class is used for. It is used in LegoGameState::LegoGameState when loading the background color, and for loading the "fsmovie" variable
// OFFSET: LEGO1 0x1003bec0
MxStringVariable::~MxStringVariable()
{
delete &m_string;
delete &m_name;
}
// OFFSET: LEGO1 0x1003bea0
MxString *MxStringVariable::GetString()
@ -21,3 +13,10 @@ void MxStringVariable::SetString(const char *colorString)
{
m_string = colorString;
}
//FIXME: Figure out what exactly this class is used for. It is used in LegoGameState::LegoGameState when loading the background color, and for loading the "fsmovie" variable
// OFFSET: LEGO1 0x1003bec0
void MxStringVariable::Destroy()
{
delete this;
}

View File

@ -10,7 +10,7 @@ class MxStringVariable
MxStringVariable() {}
virtual MxString *GetString();
virtual void SetString(const char *colorString);
virtual ~MxStringVariable();
virtual void Destroy();
protected:
MxString m_name;