mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
remove more std::move
std::move needs to be used with pointers, we werent doing that and so a temp var was being copied onto the heap when it should of stayed on the stack. This caused memory leaks
This commit is contained in:
parent
5fc9da789b
commit
8176145aaa
6 changed files with 12 additions and 40 deletions
|
|
@ -174,34 +174,6 @@ class ConsoleValue
|
|||
type = ConsoleValueType::cvNULL;
|
||||
}
|
||||
|
||||
TORQUE_FORCEINLINE void _move(ConsoleValue&& ref) noexcept
|
||||
{
|
||||
if (ref.type == ConsoleValueType::cvNULL)
|
||||
{
|
||||
std::cout << "Cannot Move a variable twice!";
|
||||
return;
|
||||
}
|
||||
switch (ref.type)
|
||||
{
|
||||
case cvInteger:
|
||||
setInt(ref.i);
|
||||
break;
|
||||
case cvFloat:
|
||||
setFloat(ref.f);
|
||||
break;
|
||||
case cvSTEntry:
|
||||
setStringTableEntry(ref.s);
|
||||
break;
|
||||
case cvString:
|
||||
setString(ref.s);
|
||||
break;
|
||||
default:
|
||||
setConsoleData(ref.ct->consoleType, ref.ct->dataPtr, ref.ct->enumTable);
|
||||
break;
|
||||
}
|
||||
ref.cleanupData();
|
||||
}
|
||||
|
||||
public:
|
||||
ConsoleValue()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue