mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
leak prevention according to: https://vld.codeplex.com/ apparently we weren't freeing the entirety of the ProfilerData linked list when resetting the Profiler, and that was leading to a pinhole leak per profiled block
This commit is contained in:
parent
c152ae86f3
commit
a4c09d1680
1 changed files with 6 additions and 3 deletions
|
|
@ -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