don't forget types...
It's normal if you've ever programmed in C/C++, at least.
Once you allocate memory (with malloc or New) you must explicitly free it. You can create a local pointer to it, but that's seperate from the actual allocated memory. If that pointer is created within a function, then it's destroyed when program execution leaves that function's scope. The allocated memory persists, which is good, because if it didn't, you'd have to use global variables or always pass in a pointer to a memory bank for the function to fill or something.
Blitz does a very, very similar thing.
Don't think of chunks of memory (type instances, memory banks, images, etc) as "variables". For these types of things, the variables are the pointers to the object, and the variables are what get destroyed when you leave scope -- not the memory blocks.
It's normal if you've ever programmed in C/C++, at least.
Once you allocate memory (with malloc or New) you must explicitly free it. You can create a local pointer to it, but that's seperate from the actual allocated memory. If that pointer is created within a function, then it's destroyed when program execution leaves that function's scope. The allocated memory persists, which is good, because if it didn't, you'd have to use global variables or always pass in a pointer to a memory bank for the function to fill or something.
Blitz does a very, very similar thing.
Don't think of chunks of memory (type instances, memory banks, images, etc) as "variables". For these types of things, the variables are the pointers to the object, and the variables are what get destroyed when you leave scope -- not the memory blocks.