[haiku-development] Re: invalid BMessengers

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 07 Aug 2008 08:57:54 +0200 CEST

Stephan Assmus <superstippi@xxxxxx> wrote:
> Ingo Weinhold wrote:
> > To sum it up, I don't think allowing to pass invalid BHandler 
> > object 
> > pointers around is anything we need or should support.
> Ok. Part of my confusion was that I thought BLooper deletes all 
> attached 
> BHandlers, but that's not the case. So at least the pointer won't go 
> stale. 
> I think I can fix my problem by constructing a BMessenger and check 
> the 
> return value of SendMessage(). If that fails, I know I have to delete 
> the 
> BHandler myself. The problem is here also that I cannot lock the 
> BLooper, 
> or I will risk a deadlock.

Can't you just create the BMessenger earlier (like in StartWatching()), 
and keep it around?


Other related posts: