I am looking at a case where I need to register a listener to the
model.  The default implementation then converts that to a graph
listener, so my question applies to both.

I don't have a way to detect when my class will be garbage collected
(OK, I could use finalize() but that is not guaranteed to be called).
My plan was to have a listener registered with the model that would
modify my class instance as appropriate.  But when my class instance
goes out of scope I want both it and the listener to be garbage
collected.

This got me wondering if the listener implementation in model (and
graph) shouldn't have weak references to the listening entities (e.g.
anything registered as a listener).

I suppose I can make my listening implementation weakly referred and
clean itself up but shouldn't the base implementation of listener do
this by default?

-- Claude

-- 
I like: Like Like - The likeliest place on the web
Identity: https://www.identify.nu/[email protected]
LinkedIn: http://www.linkedin.com/in/claudewarren

Reply via email to