Fix memory leak in VariableData

Originally committed to SVN as r4577.
This commit is contained in:
Thomas Goyne 2010-06-24 01:24:21 +00:00
parent cf9eef80ab
commit 627d423017
2 changed files with 4 additions and 4 deletions

View file

@ -70,7 +70,7 @@ AssFile::AssFile () {
/// @brief AssFile destructor /// @brief AssFile destructor
AssFile::~AssFile() { AssFile::~AssFile() {
Clear(); delete_clear(Line);
} }
void AssFile::Load (const wxString &_filename,wxString charset,bool addToRecent) { void AssFile::Load (const wxString &_filename,wxString charset,bool addToRecent) {

View file

@ -43,13 +43,13 @@
#include "variable_data.h" #include "variable_data.h"
/// @brief Constructor /// @brief Constructor
VariableData::VariableData () { VariableData::VariableData() {
type = VARDATA_NONE; type = VARDATA_NONE;
value = NULL; value = NULL;
} }
/// @brief Destructor /// @brief Destructor
VariableData::~VariableData () { VariableData::~VariableData() {
DeleteValue (); DeleteValue ();
} }
@ -64,7 +64,7 @@ void VariableData::DeleteValue () {
case VARDATA_TEXT: delete value_text; break; case VARDATA_TEXT: delete value_text; break;
case VARDATA_BOOL: delete value_bool; break; case VARDATA_BOOL: delete value_bool; break;
case VARDATA_COLOUR: delete value_colour; break; case VARDATA_COLOUR: delete value_colour; break;
case VARDATA_BLOCK: delete value_block; break; case VARDATA_BLOCK: delete *value_block; delete value_block; break;
default: break; default: break;
} }
type = VARDATA_NONE; type = VARDATA_NONE;