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
656a8ac0bd
commit
cb7dab4052
1 changed files with 2 additions and 21 deletions
|
|
@ -154,37 +154,18 @@ class ConsoleValue
|
||||||
|
|
||||||
TORQUE_FORCEINLINE bool hasAllocatedData() const
|
TORQUE_FORCEINLINE bool hasAllocatedData() const
|
||||||
{
|
{
|
||||||
return (isConsoleType() && data != NULL);
|
return (type == ConsoleValueType::cvString || isConsoleType()) && data != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* getConsoleData() const;
|
const char* getConsoleData() const;
|
||||||
|
|
||||||
TORQUE_FORCEINLINE void cleanupData()
|
TORQUE_FORCEINLINE void cleanupData()
|
||||||
{
|
{
|
||||||
switch (type)
|
if (hasAllocatedData())
|
||||||
{
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
type = ConsoleValueType::cvNULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue