[openbeos] Re: input_server filter issue

  • From: Michael Phipps <mphipps1@xxxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Wed, 17 Mar 2004 22:33:51 -0500

Jérôme - 

That is a very good catch of a race condition (it shouldn't happen - the 
lowest time it can take for a SS to get invoked is 30 seconds, but still...)
I fixed it, as you suggested, but the input_server still crashes. 

Any other ideas?

On 2004-03-17 at 05:54:06 [-0500], Jérôme Duval wrote:
> Hi Michael,
> 
> I have a idea which can happen to be your problem. Let me explain :
> 
> Your BMessageFilter is installed in your SSISFilter::SSISFilter() with 
> AddFilter().
> But SSISFilter *fltr is still NULL, not inited,  when timeUpFunc may be 
> called.
> 
> One thing you can try :
> 
> SSISFilter *fltr = NULL;
> 
> if (fltr)
>    fltr->CheckTime();
> 
> i also have a doubt about having be_app and be_app_messenger available in a 
> loaded addon, but why not.
> 
> Hope it helps,
> Jerome
> 
> Selon Michael Phipps <mphipps1@xxxxxxxxxxxxxxxx>:
> 
> > I have been working on an input server filter for ScreenSaver. The 
general 
> > gist of it is that we add a BMessageRunner to the input_server. It's job 
is 
> > to post a message to the Input Server every N seconds (where N is what 
you 
> > set in the screen saver preferences app). A BMessageFilter catches that 
> > message and calls a function checking to see if keys were hit and, if 
not, 
> > to
> > 
> > invoke screensaver. 
> > 
> > Now, I am sure that I have done something dumb... But my problem is that 
> > when
> > 
> > I create a BMessageFilter and call be_app->AddFilter(filter); At that 
> > point, the Input Server crashes. So, obviously, I can't do a whole lot of 
> > debugging. 
> > 
> > I can verify that be_app seems to be valid (and it should be). I can't 
think
> > 
> > of any reason that this should fail. 
> > 
> > Here is the relevant code:
> > 
> > SSISFilter::SSISFilter() : enabled(false) {
> >     pref.LoadSettings();
> >     blank=pref.GetBlankCorner();
> >     keep=pref.GetNeverBlankCorner();
> >     timeMsg=new BMessage(timeUp);
> >     runner=new BMessageRunner(be_app_messenger, timeMsg, pref.BlankTime() 
> > *1000000,-1);
> >     filter=new BMessageFilter(timeUp,timeUpFunc);
> >     be_app->AddFilter(filter);
> > }  
> > 
> > I am open to thoughts and ideas...
> > 
> 

Other related posts: