diff --git a/Engine/source/platform/profiler.cpp b/Engine/source/platform/profiler.cpp index ca34b4593..fb60453fc 100644 --- a/Engine/source/platform/profiler.cpp +++ b/Engine/source/platform/profiler.cpp @@ -214,12 +214,10 @@ Profiler::~Profiler() void Profiler::reset() { mEnabled = false; // in case we're in a profiler call. - ProfilerData * head = mProfileList; - ProfilerData * curr = NULL; - while ((curr = head) != NULL) + while (mProfileList) { - head = head->mNextProfilerData; - free(curr); + free(mProfileList); + mProfileList = NULL; } for(ProfilerRootData *walk = ProfilerRootData::sRootList; walk; walk = walk->mNextRoot)