mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
leak prevention according to: https://vld.codeplex.com/ ConsoleValue() constructors and destructors to handle corner-cases not already addressed via init, and cleanup
This commit is contained in:
parent
a4c09d1680
commit
b1e8a45a48
1 changed files with 3 additions and 1 deletions
|
|
@ -191,7 +191,7 @@ public:
|
||||||
|
|
||||||
void cleanup()
|
void cleanup()
|
||||||
{
|
{
|
||||||
if (bufferLen > 0)
|
if ((type <= TypeInternalString) && (bufferLen > 0))
|
||||||
{
|
{
|
||||||
dFree(sval);
|
dFree(sval);
|
||||||
bufferLen = 0;
|
bufferLen = 0;
|
||||||
|
|
@ -201,6 +201,8 @@ public:
|
||||||
ival = 0;
|
ival = 0;
|
||||||
fval = 0;
|
fval = 0;
|
||||||
}
|
}
|
||||||
|
ConsoleValue(){ init(); };
|
||||||
|
~ConsoleValue(){ cleanup(); };
|
||||||
};
|
};
|
||||||
|
|
||||||
// Proxy class for console variables
|
// Proxy class for console variables
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue