[mythtv] [mythtv-commits] mythtv commit: r9285 - in trunk/mythtv by kkuphal

Chris Pinkham cpinkham at bc2va.org
Tue Mar 7 20:30:57 UTC 2006


* On Tue Mar 07, 2006 at 03:21:05PM -0500, Chris Pinkham wrote:
> * On Tue Mar 07, 2006 at 01:24:49PM -0600, Kevin Kuphal wrote:
> > > And is this part going to cause a leak because we are setting TV::lastProgram
> > > without first deleting the old one?
> > >
> > >         while (tv->getJumpToProgram())
> > >         {
> > >             lastProgram = tv->getLastProgram();
> > >             ProgramInfo *tmpProgram = new ProgramInfo(*lastProgram);
> > >
> > >             lastProgram = new ProgramInfo(*tvrec);
> > >             tv->setLastProgram(lastProgram);
> > >
> > > We get the lastProgram, make a copy of it, make a copy of tvrec,
> > > then assign the copy to TV::lastProgram.  Are we freeing the current
> > > value in TV::lastProgram somewhere that I'm not seeing?
> > >   
> > I *believe* it gets deleted when the progLists.clear() is executed.  At 
> > least, I was getting a segfault when I tried to delete it in that 
> > section of code above because I think it was doing a double delete.
> 
> The segfault may have been happening on the first time through the loop, but I
> don't think it would happen on subsequent loops.

Replying to myself...

I think that the issue is because you don't 'new' when you save the lastProgram
inside of TV::SetJumpToProgram(), but you do 'new' when you save inside of
PlaybackBox::play().  If you add a 'new' inside of TV::SetJumpToProgram(), then
you should be able to perform the delete inside of PlaybackBox::play().

--
Chris


More information about the mythtv-dev mailing list