iOS Question Is it possible to capture dealloc in a B4i class?

keirS

Well-Known Member
Licensed User
Longtime User
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.
 

keirS

Well-Known Member
Licensed User
Longtime User
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.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is it likely that B4J/B4A will get the same functionality
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.
 
Upvote 0
Top