[openbeos] Re: Tracker bug and screen saver question

  • From: Fredrik Ekdahl <fekdahl@xxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Thu, 18 Jan 2007 16:35:26 +0100

François Revol skrev:
void
ScreenSaver::StopSaver()
{
        if (fGLView && fGLView->LockLooper()) {
                BLooper *l = fGLView->Looper();
                fGLView->RemoveSelf();
                l->Unlock();
        }
        delete fGLView;
        fGLView = NULL;
}
In preview mode, fGLView->LockLooper() returns false. I suppose that means that it is already removed from the view when StopSaver() is called. The occasional crashes happens when (in preview mode) calling "delete fGLView;" I'm not really sure I'm doing anything wrong here. The only solution I've found is to not delete the glview when doing preview. Rather a memory leak than a crash :)

/Fredrik Ekdahl

Other related posts: