[Live-devel] memory leaks in DelayQueue ?
PROMONET Michel
michel.promonet at thalesgroup.com
Tue Dec 13 05:52:27 PST 2011
Hi,
I continue to analyse memory leaks at exit, so I have an other valgrind report to submit to your mailing list :
192 bytes in 3 blocks are definitely lost in loss record 1 of 1
(see: http://valgrind.org/docs/manual/mc-manual.html#mc-manual.leaks)
at 0x4C27CC1: operator new(unsigned long) (vg_replace_malloc.c:261)
by 0xDF883C: BasicTaskScheduler0::scheduleDelayedTask(long, void (*)(void*), void*) (BasicTaskScheduler0.cpp:64)
by 0xDF6228: schedulerTickTask(void*) (BasicTaskScheduler.cpp:37)
by 0xDF8BFA: AlarmHandler::handleTimeout() (BasicTaskScheduler0.cpp:34)
by 0xDF75B9: DelayQueue::handleAlarm() (DelayQueue.cpp:180)
by 0xDF6BAF: BasicTaskScheduler::SingleStep(unsigned int) (BasicTaskScheduler.cpp:190)
by 0xDF87C4: BasicTaskScheduler0::doEventLoop(char*) (BasicTaskScheduler0.cpp:81)
I propose a fix something like :
In BasicUsageEnvironment/DelayQueue.cpp
DelayQueue::~DelayQueue() {
- while (fNext != this) removeEntry(fNext);
+ while (fNext != this) { DelayQueueEntry* entry=fNext; removeEntry(fNext) ; delete entry; };
}
I haven't deeply investigate how works this chained list, but seems to makes valgrind happy.
Do you think this is acceptable ?
Regards,
Michel.
[@@THALES GROUP RESTRICTED@@]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20111213/cb937faf/attachment.html>
More information about the live-devel
mailing list