Ah, I now see where I made a mistake; I took the class instance that holds the queued function as something standing on its own. But the instance is indeed a class member of the stopping/stopped module.

I also took it for 'granted' that a class instance could not be destroyed/collected as so long as it was 'active'. But that would mean you could never ever close any program at all. :) Silly me.

I understand now. Thank you for your patience.

Coen

On 3/29/2010 16:00, Marcus Agehall (nu med K-märkt fastighet) @ Pike (-) developers forum wrote:
Ok, so then the situation is like this:

1) You run your module and the worker queue for your thread has X
items.

2) You decide to stop the server and the stop() method in your module
is called.

3) Your stop() method enqueues a stop-command to your worker thread as
command X+1 and returns.

4) Roxen starts destroying your module and it's variables.

5) Your worker thread processes commands and tries to access variables
that have already been destroyed.

The ONLY way around this, is to ensure that your worker thread is
stopped when you return from stop() in your module. 9 out of 10 times,
other solutions are just plain wrong and should be avioded.
  


--
Signature Met vriendelijke groet / With kind regards / mit besten Grüßen,




Coen Schalkwijk
Software Engineer

coen.schalkwijk@rtl.nl

coen@rtlinteractief.nl

+31 (0)35 671 8915