[Kwintv] crash in QtVision::SetChannel
Dawit A.
kwintv@mail.kde.org
Mon, 28 Oct 2002 00:55:37 -0500
On Sunday 27 October 2002 13:16, Richard Moore wrote:
> Rizsanyi Zsolt wrote:
> > On Sunday 27 October 2002 01:54, Dawit A. wrote:
> > > > I see some possible solutions to this:
> > > > 1) remove this previous channel thing - it is only used for dcop if I
> > > > understand it correctly, and I dont see for what it is good for
> > >
> > > No, do not do that. It is very simple to fix this problem. FWIW, the
> > > _prevChannel is a feature that allows you to go back to the previous
> > > channel by pressing one configurable shortcut key. By default this is
> > > Key_L. This is the same feature available on many TV sets/Remote
> > > controls as go back, Last, recall, previous etc...
> >
> > I did not know about that feature.
> >
> > > > 3) take care to do '_chan = NULL' when the channel store is deleted
> > > > (or that exact channel is deleted) -- this may be impossible
> > >
> > > And why is this impossible ? Channel is a QObject. All one has to do
> > > is connect to its destroyed signal and reset the local pointer
> > > accordingly.
> >
> > I'm not that proficient in Qt programming yet... :)
>
> In this case I suspect the easiest answer is just to use a
> QGuardedPointer, that way it will automatically become 0 when required.
I think that is even a better idea since I won't need to worry connecting the
signals and such though it might pose a bit more overhead. I will do that
instead then. I think the same should be applied to the ChannelStore pointer
as well.
Regards,
Dawit A.