PDA

View Full Version : Solved: check if variables released



philfer
01-25-2008, 12:45 PM
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

akn112
01-25-2008, 01:27 PM
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

Bob Phillips
01-25-2008, 01:31 PM
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.