mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +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
|
||||
{
|
||||
return (type == ConsoleValueType::cvString || isConsoleType()) && data != NULL;
|
||||
return (type == ConsoleValueType::cvString || isConsoleType()) && data != NULL;
|
||||
}
|
||||
|
||||
const char* getConsoleData() const;
|
||||
|
|
@ -182,14 +182,16 @@ class ConsoleValue
|
|||
TORQUE_CASE_FALLTHROUGH;
|
||||
case cvString:
|
||||
s = ref.s;
|
||||
ref.s = const_cast<char*>(StringTable->EmptyString());
|
||||
break;
|
||||
default:
|
||||
data = ref.data;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
ref.type = ConsoleValueType::cvSTEntry;
|
||||
ref.data = NULL;
|
||||
ref.setEmptyString();
|
||||
//ref.reset();
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
@ -305,9 +307,7 @@ public:
|
|||
}
|
||||
|
||||
cleanupData();
|
||||
|
||||
type = ConsoleValueType::cvString;
|
||||
|
||||
s = (char*)dMalloc(static_cast<dsize_t>(len) + 1);
|
||||
s[len] = '\0';
|
||||
dStrcpy(s, val, static_cast<dsize_t>(len) + 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue