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.

Local variables are cleaned up on the next automatic GC call if they went out of scope.
But this happens ONLY when you are in Strict or SuperStrict.

Without Strict, you don't have any local reference checking and using local might cause quite some interesting stuff.


What I actually don't see is why it should cause problems.
You can't use the object anymore after it went out of scope, so how should it interfer at all, unless you gave it some automatic "handling" which is a quite bad idea on a local object that is meant to life within a "time box" (ie from start to the end of the function at max with no interaction to the outside, otherwise it wouldn't be a local)