Update console.h

This commit is contained in:
marauder2k7 2025-05-10 14:46:49 +01:00
parent a993b72881
commit 656a8ac0bd

View file

@ -161,16 +161,29 @@ class ConsoleValue
TORQUE_FORCEINLINE void cleanupData()
{
if (hasAllocatedData())
switch (type)
{
case ConsoleValueType::cvConsoleValueType:
if (ct)
{
delete ct;
ct = nullptr;
}
break;
case ConsoleValueType::cvString:
if (s && s != StringTable->EmptyString())
dFree(s);
break;
default:
break;
}
if (data != NULL)
{
dFree(data);
data = NULL;
}
else if (type == ConsoleValueType::cvString)
{
if (s != StringTable->EmptyString())
dFree(s);
}
type = ConsoleValueType::cvNULL;
}