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:
marauder2k7 2025-05-09 08:47:34 +01:00
parent 5fc9da789b
commit 8176145aaa
6 changed files with 12 additions and 40 deletions

View file

@ -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()
{