Merge pull request #1333 from Azaezel/PluggingLeaks

Plugging Memory Leaks
This commit is contained in:
Daniel Buckmaster 2015-06-28 14:41:13 +10:00
commit d89c3b7c6f
2 changed files with 9 additions and 4 deletions

View file

@ -191,7 +191,7 @@ public:
void cleanup()
{
if (bufferLen > 0)
if ((type <= TypeInternalString) && (bufferLen > 0))
{
dFree(sval);
bufferLen = 0;
@ -201,6 +201,8 @@ public:
ival = 0;
fval = 0;
}
ConsoleValue(){ init(); };
~ConsoleValue(){ cleanup(); };
};
// Proxy class for console variables