mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
Merge pull request #1333 from Azaezel/PluggingLeaks
Plugging Memory Leaks
This commit is contained in:
commit
d89c3b7c6f
2 changed files with 9 additions and 4 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
|
||||||
|
|
|
||||||
|
|
@ -212,11 +212,14 @@ Profiler::~Profiler()
|
||||||
void Profiler::reset()
|
void Profiler::reset()
|
||||||
{
|
{
|
||||||
mEnabled = false; // in case we're in a profiler call.
|
mEnabled = false; // in case we're in a profiler call.
|
||||||
while(mProfileList)
|
ProfilerData * head = mProfileList;
|
||||||
|
ProfilerData * curr = NULL;
|
||||||
|
while ((curr = head) != NULL)
|
||||||
{
|
{
|
||||||
free(mProfileList);
|
head = head->mNextProfilerData;
|
||||||
mProfileList = NULL;
|
free(curr);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(ProfilerRootData *walk = ProfilerRootData::sRootList; walk; walk = walk->mNextRoot)
|
for(ProfilerRootData *walk = ProfilerRootData::sRootList; walk; walk = walk->mNextRoot)
|
||||||
{
|
{
|
||||||
walk->mFirstProfilerData = 0;
|
walk->mFirstProfilerData = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue