Sign in to follow this  
Followers 0
cbadal

Function cleanup

2 posts in this topic

I have an AutoIt program that does a lot of string processing.

I create many, many strings.

So my question is "When does cleanup occur"?

1. When my function exits, do all of the strings I created locally get freed up?

2. Or does that memory get cleaned up only when the program exits?

If it' #1, then I'll leave my code alone. But if it's #2 I may consider cutting down on my string creation.

Share this post


Link to post
Share on other sites



When you set a variable equal to something, it's previous value is freed, according to it's type.

If the variable is local, it will also be freed at the end of it's scope.

Anything declared globally will be freed on exit.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0