On 01/17/2007 09:22 AM, Melchior FRANZ wrote:
 > An old-school
> polling loop wouldn't be less effective.

Ah, don't worry, there is a solution -- involving a timer
rather than a listener -- that is adequate for this unusual
purpose.  Not elegant, but adequate.

> Letting a listener remove itself is a bad idea. Trying that
> does now issue an error message. 

May I ask why this is a bad idea?  It seems like a useful
thing to do, and not hard to implement safely.
  -- For static code, I don't seen any issues at all;
   we're just throwing away a pointer to the code, not
   throwing away the code.
  -- For anonymous code fragments, the trick is to put a
   reference to the code in the frame of the code itself.
   Then in the tricky case where there are no /other/
   references to the code, there will still be one
   reference while the code is running ... and when
   the code finishes that one last reference will go
   out of scope and we're free to garbage-collect the
   code.

Or am I overlooking something?

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to