diff --git a/engine/src/C4PropList.cpp b/engine/src/C4PropList.cpp index b71a8caae..5a4159a59 100644 --- a/engine/src/C4PropList.cpp +++ b/engine/src/C4PropList.cpp @@ -1,6 +1,7 @@ #include #include #include +#include void C4PropList::AddRef(C4Value *pRef) { @@ -21,6 +22,11 @@ void C4PropList::DelRef(const C4Value * pRef, C4Value * pNextRef) assert(pVal->NextRef); pVal->NextRef = pNextRef; } + if (FirstRef) return; + // These classes have their own memory management + if (dynamic_cast(this)) return; + if (dynamic_cast(this)) return; + delete this; } void C4PropList::AssignRemoval()