[IGSTK-Developers] Re: PulseGenerator memory leak

Luis Ibanez luis.ibanez at kitware.com
Fri Jan 27 12:49:35 EST 2006

Hi David,

Thanks a lot for tracking this down.

Following your directions, I added the code for clearing
the m_FreeTimeout in the destructor of the PulseGenerator.

A SimpleMutexLock was also added in order to protect the
increments and decrements of the NumberOfPulseGenerators.


David Gobbi wrote:
> Oops, forgot to mention the bug number: 2772.
> David Gobbi wrote:
>> I looked into memory leak for igstkViewTest and igstkViewRefreshRateTest.
>> The leaky static variable is igstk::PulseGenerator::m_FreeTimeout.  It 
>> looks like this variable is meant to store spare Timeout objects for 
>> the sake of efficiency.
>> There should be a static counter variable m_NumberOfPulseGenerators so 
>> that when the last PulseGenerator object is destroyed, the 
>> m_FreeTimeout list can be deallocated.  The code would go into the 
>> PulseGenerator destructor.

More information about the IGSTK-Developers mailing list