B4J Question close form

ziomorgan

Active Member
Licensed User
Longtime User
Hi,
when I close a form, its objects are initialized yet.
can i free all memory of a closed form?
(VB6 example: set myForm = nothing)
thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
My previous answer was not accurate. The nodes, like any other objects, will be destroyed when they are not referenced any more.

In almost all cases you should not be bothered about it. When you load the new layout the variables will point to the new nodes and the old ones will be destroyed.

You can use a class to manage the form. Then when you close the form you can remove the class instance reference and all the class objects will be released.
 
Upvote 0
Top