Jump to content

Event handlers and trash collection?


davej

Recommended Posts

Should any extra thought go into trying to avoid the use of local variables inside event handlers? I see some people seemingly do that. I don't know how quickly or efficiently trash collection works but for small variables I would not expect it to be an issue worthy of consideration.

Link to comment
Share on other sites

When the event handler is called, local variables are created. When the event handler finishes executing the variables are destroyed. No memory leaks or efficiency problems.

Link to comment
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
×
×
  • Create New...