03-16-2017, 05:59 PM
@Seadragon91 In your code, when calling the collectgarbage() function, the area variable is still in scope so it is not collected yet. Upon the next call, the cBlockArea from the previous call is collected and the current one is still kept, and so on.
(Yes, garbage collection is difficult
NiLSPACE's code fixes that by enclosing the inner code in yet another do .. end, which makes the area variable go out of scope before calling the collectgarbage() function, allowing it to be collected.
(Yes, garbage collection is difficult
NiLSPACE's code fixes that by enclosing the inner code in yet another do .. end, which makes the area variable go out of scope before calling the collectgarbage() function, allowing it to be collected.