Merge pull request #1413 from Azaezel/LittleLeakLost

partial reversion for #1333
This commit is contained in:
Anis 2016-02-25 18:29:50 +01:00
commit 8f4295879d

View file

@ -215,13 +215,21 @@ void Profiler::reset()
{
mEnabled = false; // in case we're in a profiler call.
ProfilerData * head = mProfileList;
ProfilerData * curr = NULL;
while ((curr = head) != NULL)
ProfilerData * curr = head;
while ( curr )
{
head = head->mNextProfilerData;
free(curr);
head = curr->mNextProfilerData;
free( curr );
if ( head )
curr = head;
else
curr = NULL;
}
mProfileList = NULL;
for(ProfilerRootData *walk = ProfilerRootData::sRootList; walk; walk = walk->mNextRoot)
{
walk->mFirstProfilerData = 0;