Optimised compile and "Dispose"

agraham

Expert
Licensed User
Longtime User
There is a behavioural difference between the IDE/legacy compile and optimised compile with "Dispose" on a library object. If you "New" an object from a library and "Dispose" it then in the IDE and legacy compiler the object seems to vanish and trying to reuse with another "New" errors. The optimised compiler however will happily renew it which could be useful in saving memory. Could the IDE/legacy compiler be brought into line with the optimising compiler in a future release?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The difference is that in the IDE you will need to add AddObject before the second "New".
There is no difference with the memory usage and the optimized compiler supports this AddObject as well.

The optimized compiler treats AddObject as a compiler directive. So calling it once (with AddObject or with Tools - Add Object) is enough.
 
Top