Local variable lifetime

BlitzMax Forums/BlitzMax Programming/Local variable lifetime

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

In C++ nothing is GCed, as C++ has no GC, so a little strange comparision :)

It will just be freed due to the fact that its whole stack frame is removed.
Thats a major difference between managed and not managed languages.

But yes if you use external objects you need to be free for sure at the end of the function, do it manually.

As the documentation clearly states: never do anything, that needs to be done at a specific moment within the delete as there is no execution order guarantee nor execution time guarantee for the cleanup through the GC.
Or to make it worse: if you call end within your app, NO further delete methods will be called!