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:
Azaezel 2015-06-02 14:25:08 -05:00
parent a4c09d1680
commit b1e8a45a48

View file

@ -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