[Kwintv] Patch to fix memory leak when lirc-support is in

George Staikos kwintv@mail.kde.org
Tue, 15 Oct 2002 09:50:57 -0400


On Tuesday October 15 2002 07:35, Rizsanyi Zsolt wrote:
> > > Correct me if I'm wrong, but if an QObject has a declared parent, then
> > > it will be automatically deleted when the parent is deleted.
> >
> > Really? OK, I didn't know that.
> >
> > I ran qtvision through LeakTracer (http://www.andreasen.org/LeakTracer/)
> > and it found this to be a memory leak - but you may be right.
> >
> > > So this fix is not needed... (and even could cause a crash because of
> > > double deletion)
> >
> > My added "delete lirc" doesn't make it crash.
>
> I'm not a qt guru either. I just read that in the Qt documentation.
> But if your leaktracer shows that, then maybe somebody with more knowledge
> could help us out.

  Furthermore, if it is only created once and deleted on exit, then it doesn't 
matter because it can't leak more than once which is ok.

  After seeing this patch, I'm wondering if mainwindow is the right place to 
put the lirc code though.  This code should really work in other clients too 
(the panel applet, extension, etc).  Is there a better place for it?


-- 

George Staikos