I am using an observer pattern in a set of classes. I have an observer unregistration method already but I would like to make sure that that the object is unregistered.
Thanks Erel. I didn't realize that existed. Is it likely that B4J/B4A will get the same functionality? If not I will wrap the java.lang.ref.WeakReference class and use it for the B4J/B4A versions so it should work the same across the platforms.
Unlikely as it is almost never needed in those platforms. It is needed in B4i because there is no garbage collector and you need to avoid circular references.
It is most probably a bad idea to rely on the GC behavior. If you need to release resources then add a Release method to your objects.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.