Is there an easy way at the end of code to look at all the variables used in your code and check they have been released
I read about memory leak recently and I am getting paranoid
Is there an easy way at the end of code to look at all the variables used in your code and check they have been released
I read about memory leak recently and I am getting paranoid
just set all of them equal to nothing at the end of the code, not the middle. That way you have all your declaration up top and can compare your object destructors at the end
If it is string/long/double etc. type variables tere is not a lot that you can do. You can reduce string memory consumption by setting to "" or Empty, but setting a long to say 0 is the same as setting it to 123456789.
Objects are different, and if you don't trust VBA garbage cleanup, then just set each object that you declare to Nothing before exiting the procedure within whose scope the object is declared.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber