diff --git a/src/fragglescript/t_script.cpp b/src/fragglescript/t_script.cpp index bbf333acf..f1376b7eb 100644 --- a/src/fragglescript/t_script.cpp +++ b/src/fragglescript/t_script.cpp @@ -162,6 +162,19 @@ DFsScript::DFsScript() 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; +} + //========================================================================== // // diff --git a/src/fragglescript/t_script.h b/src/fragglescript/t_script.h index 7f89652e6..3734e16b8 100644 --- a/src/fragglescript/t_script.h +++ b/src/fragglescript/t_script.h @@ -336,6 +336,7 @@ public: // true or false DFsScript(); + ~DFsScript(); void Destroy(); void Serialize(FSerializer &ar);