[vtkusers] Memory Leak in vtkTimerLog ??

de Boer Ingo I.deBoer at polytec.de
Tue Oct 7 11:15:13 EDT 2003


Hi,

maybe it's in my programming, but I have a memory leak of
5200 Bytes. My debugger (.net 2002 studio) told me that the
leak is around the vtkTimerLog

//----------------------------------------------------------------------------
// Allocate timing table with MaxEntries elements.
void vtkTimerLog::AllocateLog()
{
  if (vtkTimerLog::TimerLog != NULL)
    {
    delete [] vtkTimerLog::TimerLog;
    }
  vtkTimerLog::TimerLog = new vtkTimerLogEntry[vtkTimerLog::MaxEntries];
}

As I see from the code the TimerLog is created but where is the delete?
There is no delete in the destructor. Okay.. I tried to put something
like
  if (vtkTimerLog::TimerLog != NULL)
    {
    delete [] vtkTimerLog::TimerLog;
    }
in the destructor. But it was even more mess...

Any hints ?

greets  
  Ingo


---
Dr.-Ing. Ingo H. de Boer

Polytec GmbH
Polytec-Platz 1-7, 76337 Waldbronn, Germany
phone: ++49 7243 604 106
fax  : ++49 7243 604 255
 



More information about the vtkusers mailing list