mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Revert "Update console.h"
This reverts commit f10080489995570036e2e5ba762357559a0abd34.
This commit is contained in:
parent
2b14e5448e
commit
0df6e99a75
1 changed files with 21 additions and 2 deletions
|
|
@ -154,18 +154,37 @@ class ConsoleValue
|
||||||
|
|
||||||
TORQUE_FORCEINLINE bool hasAllocatedData() const
|
TORQUE_FORCEINLINE bool hasAllocatedData() const
|
||||||
{
|
{
|
||||||
return (type == ConsoleValueType::cvString || isConsoleType()) && data != NULL;
|
return (isConsoleType() && data != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* getConsoleData() const;
|
const char* getConsoleData() const;
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type = ConsoleValueType::cvNULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue