On Fri, Oct 07, 2005 at 10:13:38PM -0400, Daniel Kristjansson wrote: > On Fri, 2005-10-07 at 21:31 -0400, Daniel Kristjansson wrote: > > On Sat, 2005-10-08 at 00:58 +0100, Stuart Auchterlonie wrote: > > > btw. This is the biggest leak of them all.... > > I can imagine. > > Try the attached patch, it should fix this leak and some others > without doing anything questionable. >
Adding a proper destructor to siparser looks like its done the trick. According to valgrind all the leaks that came from under siparser's table handling have gone :-) However there is another culprit, the table handling in mpegstreamdata. That appears to leaks as well, albeit quite slowly. Relevant bits of valgrind attached.... Stuart ---- ==12136== 9776 bytes in 52 blocks are definitely lost in loss record 306 of 328 ==12136== at 0x1B900080: operator new[](unsigned) (vg_replace_malloc.c:197) ==12136== by 0x1BE66CBD: PESPacket::PESPacket(PESPacket const&) (pespacket.h:65) ==12136== by 0x1BE669F5: PSIPTable::PSIPTable(PSIPTable const&) (mpegtables.h:178) ==12136== by 0x1BE661CE: ProgramMapTable::ProgramMapTable(PSIPTable const&) (mpegtables.h:382) ==12136== by 0x1BE6544A: ProgramMapTable::CreateBlank() (mpegtables.h:376) ==12136== by 0x1BE62F3C: ProgramMapTable::Create(unsigned, unsigned, unsigned, unsigned, std::vector<unsigned, std::allocator<unsigned> >, std::vector<unsigned, std::allocator<unsigned> >) (mpegtables.cpp:63) ==12136== by 0x1BE72DAE: MPEGStreamData::CreatePMTSingleProgram(ProgramMapTable const&) (mpegstreamdata.cpp:255) ==12136== by 0x1BE73761: MPEGStreamData::HandleTables(unsigned, PSIPTable const&) (mpegstreamdata.cpp:329) ==12136== by 0x1BE7996A: ATSCStreamData::HandleTables(unsigned, PSIPTable const&) (atscstreamdata.cpp:133) ==12136== by 0x1BE74181: MPEGStreamData::HandleTSTables(TSPacket const*) (mpegstreamdata.cpp:400) ==12136== by 0x1BE7431A: MPEGStreamData::ProcessTSPacket(TSPacket const&) (mpegstreamdata.cpp:438) ==12136== by 0x1BE74257: MPEGStreamData::ProcessData(unsigned char*, int) (mpegstreamdata.cpp:423) ==12136== ==12136== ==12136== 193640 (1920 direct, 191720 indirect) bytes in 48 blocks are definitely lost in loss record 314 of 328 ==12136== at 0x1B8FFC42: operator new(unsigned) (vg_replace_malloc.c:164) ==12136== by 0x1BE736C2: MPEGStreamData::HandleTables(unsigned, PSIPTable const&) (mpegstreamdata.cpp:324) ==12136== by 0x1BE7996A: ATSCStreamData::HandleTables(unsigned, PSIPTable const&) (atscstreamdata.cpp:133) ==12136== by 0x1BE74181: MPEGStreamData::HandleTSTables(TSPacket const*) (mpegstreamdata.cpp:400) ==12136== by 0x1BE7431A: MPEGStreamData::ProcessTSPacket(TSPacket const&) (mpegstreamdata.cpp:438) ==12136== by 0x1BE74257: MPEGStreamData::ProcessData(unsigned char*, int) (mpegstreamdata.cpp:423) ==12136== by 0x1BF32C22: DVBSignalMonitor::RunTableMonitor() (dvbsignalmonitor.cpp:298) ==12136== by 0x1BF306CA: DVBSignalMonitor::TableMonitorThread(void*) (dvbsignalmonitor.cpp:144) ==12136== by 0x1D2E8F3B: pthread_start_thread (manager.c:310) ==12136== by 0x1D4D98B9: clone (clone.S:119) ==12136== ==12136== ==12136== 12492 (84 direct, 12408 indirect) bytes in 3 blocks are definitely lost in loss record 320 of 328 ==12136== at 0x1B8FFC42: operator new(unsigned) (vg_replace_malloc.c:164) ==12136== by 0x1BE73520: MPEGStreamData::HandleTables(unsigned, PSIPTable const&) (mpegstreamdata.cpp:303) ==12136== by 0x1BE7996A: ATSCStreamData::HandleTables(unsigned, PSIPTable const&) (atscstreamdata.cpp:133) ==12136== by 0x1BE74181: MPEGStreamData::HandleTSTables(TSPacket const*) (mpegstreamdata.cpp:400) ==12136== by 0x1BE7431A: MPEGStreamData::ProcessTSPacket(TSPacket const&) (mpegstreamdata.cpp:438) ==12136== by 0x1BE74257: MPEGStreamData::ProcessData(unsigned char*, int) (mpegstreamdata.cpp:423) ==12136== by 0x1BF32C22: DVBSignalMonitor::RunTableMonitor() (dvbsignalmonitor.cpp:298) ==12136== by 0x1BF306CA: DVBSignalMonitor::TableMonitorThread(void*) (dvbsignalmonitor.cpp:144) ==12136== by 0x1D2E8F3B: pthread_start_thread (manager.c:310) ==12136== by 0x1D4D98B9: clone (clone.S:119) ==12136==
_______________________________________________ mythtv-dev mailing list [email protected] http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
