- added a destructor zo DFsScript, because if this gets deleted outside the GC process it'll leave an allocated buffer behind, so make sure it always gets destroyed.

This commit is contained in:
Christoph Oelckers 2016-09-23 08:26:36 +02:00
parent f397a4943c
commit 4964f94de1
2 changed files with 14 additions and 0 deletions

View file

@ -162,6 +162,19 @@ DFsScript::DFsScript()
lastiftrue = false; lastiftrue = false;
} }
//==========================================================================
//
// This is here to delete the locally allocated buffer in case this
// gets forcibly destroyed
//
//==========================================================================
DFsScript::~DFsScript()
{
if (data != NULL) delete[] data;
data = NULL;
}
//========================================================================== //==========================================================================
// //
// //

View file

@ -336,6 +336,7 @@ public:
// true or false // true or false
DFsScript(); DFsScript();
~DFsScript();
void Destroy(); void Destroy();
void Serialize(FSerializer &ar); void Serialize(FSerializer &ar);