mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
Update console.h
This commit is contained in:
parent
a993b72881
commit
656a8ac0bd
1 changed files with 19 additions and 6 deletions
|
|
@ -161,16 +161,29 @@ class ConsoleValue
|
||||||
|
|
||||||
TORQUE_FORCEINLINE void cleanupData()
|
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);
|
dFree(data);
|
||||||
data = NULL;
|
data = NULL;
|
||||||
}
|
}
|
||||||
else if (type == ConsoleValueType::cvString)
|
|
||||||
{
|
|
||||||
if (s != StringTable->EmptyString())
|
|
||||||
dFree(s);
|
|
||||||
}
|
|
||||||
type = ConsoleValueType::cvNULL;
|
type = ConsoleValueType::cvNULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue