On 10/10/14 16:36, Stanimir Simeonoff wrote:
The Handler automatic closure remains problematic as they don't have a defined lifecycle. close() should be invoked after there are no references and it requires calling a potentially overridden method. It can be carried by PhantomReference+WeakRefence combo, though.
I agree. However we can't use sun.misc.Cleaner for that, and it's not clear were we could/should poll() the reference queue in order to close handler. Somehow I feel that closing handlers *created by the configuration* *in the configuration reset* might be the safest route. best regards, -- daniel