mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-24 13:55:34 +00:00
moar leak plug attempts
This commit is contained in:
parent
ea39c83afd
commit
ee0cf872a0
6 changed files with 108 additions and 11 deletions
|
|
@ -203,17 +203,108 @@ public:
|
|||
|
||||
ConsoleValue(ConsoleValue&& ref) noexcept
|
||||
{
|
||||
_move(std::move(ref));
|
||||
type = ref.type;
|
||||
|
||||
switch (ref.type)
|
||||
{
|
||||
case cvInteger:
|
||||
i = ref.i;
|
||||
break;
|
||||
case cvFloat:
|
||||
f = ref.f;
|
||||
break;
|
||||
case cvSTEntry:
|
||||
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;
|
||||
}
|
||||
|
||||
TORQUE_FORCEINLINE ConsoleValue& operator=(ConsoleValue&& ref) noexcept
|
||||
{
|
||||
_move(std::move(ref));
|
||||
type = ref.type;
|
||||
|
||||
switch (ref.type)
|
||||
{
|
||||
case cvInteger:
|
||||
i = ref.i;
|
||||
break;
|
||||
case cvFloat:
|
||||
f = ref.f;
|
||||
break;
|
||||
case cvSTEntry:
|
||||
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;
|
||||
return *this;
|
||||
}
|
||||
|
||||
ConsoleValue(const ConsoleValue&) = delete;
|
||||
ConsoleValue& operator=(const ConsoleValue&) = delete;
|
||||
ConsoleValue(const ConsoleValue& ref)
|
||||
{
|
||||
type = ref.type;
|
||||
|
||||
switch (ref.type)
|
||||
{
|
||||
case cvInteger:
|
||||
i = ref.i;
|
||||
break;
|
||||
case cvFloat:
|
||||
f = ref.f;
|
||||
break;
|
||||
case cvSTEntry:
|
||||
TORQUE_CASE_FALLTHROUGH;
|
||||
case cvString:
|
||||
s = ref.s;
|
||||
break;
|
||||
default:
|
||||
data = ref.data;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ConsoleValue& operator=(const ConsoleValue& ref)
|
||||
{
|
||||
type = ref.type;
|
||||
|
||||
switch (ref.type)
|
||||
{
|
||||
case cvInteger:
|
||||
i = ref.i;
|
||||
break;
|
||||
case cvFloat:
|
||||
f = ref.f;
|
||||
break;
|
||||
case cvSTEntry:
|
||||
TORQUE_CASE_FALLTHROUGH;
|
||||
case cvString:
|
||||
s = ref.s;
|
||||
break;
|
||||
default:
|
||||
data = ref.data;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
TORQUE_FORCEINLINE ~ConsoleValue()
|
||||
{
|
||||
|
|
@ -1022,7 +1113,7 @@ namespace Con
|
|||
ConsoleValue executef(R r, ArgTs ...argTs)
|
||||
{
|
||||
_EngineConsoleExecCallbackHelper<R> callback(r);
|
||||
return std::move(callback.template call<ConsoleValue>(argTs...));
|
||||
return (callback.template call<ConsoleValue>(argTs...));
|
||||
}
|
||||
/// }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue