[openbeos] Re: input_server filter issue

On Wed, 17 Mar 2004, Michael Phipps wrote:

> 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?

The code you gave looks OK in principle. Did you try to track the bug down
systematically? That is starting with uncommenting the creation of the
message runner and the addition of the message filter and see if it still
crash, then uncommenting only one of them and the complete contents of the
filter hook function, then only a part and so on... Tedious, but should
help to track the problem down. Maybe a telnet session can least release
you from restarting the whole system after an input server crash.

That being said, I want to say, that a message filter is a bit of overkill
anyway. How about making your input server filter a BHandler, adding it to
the be_app and directing the message runner messages to it directly?

And take care not to forget to uninstall whatever you use in the
destructor, since when your add-on is unloaded, the message filter hook
function respectively your class' code will be gone, which will cause the
server to crash, when it tries to enter that code.

CU, Ingo

Other related posts: