mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 23:54:35 +00:00
Update console.h
might not fix the leak we were having around callbacks, but it really slows down the upcreep of memory
This commit is contained in:
parent
bab75a3a46
commit
ea39c83afd
1 changed files with 5 additions and 5 deletions
|
|
@ -152,7 +152,7 @@ class ConsoleValue
|
||||||
|
|
||||||
TORQUE_FORCEINLINE bool hasAllocatedData() const
|
TORQUE_FORCEINLINE bool hasAllocatedData() const
|
||||||
{
|
{
|
||||||
return (type == ConsoleValueType::cvString || isConsoleType()) && data != NULL;
|
return (type == ConsoleValueType::cvString || isConsoleType()) && data != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* getConsoleData() const;
|
const char* getConsoleData() const;
|
||||||
|
|
@ -182,14 +182,16 @@ class ConsoleValue
|
||||||
TORQUE_CASE_FALLTHROUGH;
|
TORQUE_CASE_FALLTHROUGH;
|
||||||
case cvString:
|
case cvString:
|
||||||
s = ref.s;
|
s = ref.s;
|
||||||
|
ref.s = const_cast<char*>(StringTable->EmptyString());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
data = ref.data;
|
data = ref.data;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
ref.type = ConsoleValueType::cvSTEntry;
|
||||||
ref.data = NULL;
|
ref.data = NULL;
|
||||||
ref.setEmptyString();
|
//ref.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -305,9 +307,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanupData();
|
cleanupData();
|
||||||
|
|
||||||
type = ConsoleValueType::cvString;
|
type = ConsoleValueType::cvString;
|
||||||
|
|
||||||
s = (char*)dMalloc(static_cast<dsize_t>(len) + 1);
|
s = (char*)dMalloc(static_cast<dsize_t>(len) + 1);
|
||||||
s[len] = '\0';
|
s[len] = '\0';
|
||||||
dStrcpy(s, val, static_cast<dsize_t>(len) + 1);
|
dStrcpy(s, val, static_cast<dsize_t>(len) + 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue