![]() |
#10
|
||||
|
||||
![]()
Only via the VBE watch window. If you populate a global collection (declared as public in a standard module) inside a Sub, then after executing it, you will still see the Object structure in the watch window. I guess It's bogus though coz if there is a leak then I guess VBE would remain clueless.
I'm pretty sure I can come up with some kind if recursive routine though to test the deallocation and then just check the memory usage with process explorer. Thinking about it though, for local variables, scoped inside a sub, I would have thought the scripting engine would push a block of frames into the stack on entry. And the stack pointer on entry would be stored. Then, on exit, the stack pointer would be reset to the entry value, thus obliterating all local variables. The second thing I've been thinking about is that it is impossible to reference an object declared locally in a procedure, from outside that procedure. So IF the locals are blown off the stack on exit, and given that VBA uses reference counting to manage life cycle... Well, it seems to support the argument against set to nothing just before exit. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wierd "script code" in a downloaded .doc file | CNBarnes | Word | 2 | 10-18-2012 02:07 AM |
![]() |
krishnaoptif | Word VBA | 9 | 06-22-2012 05:08 AM |
![]() |
Jamal NUMAN | Word | 2 | 07-03-2011 03:11 AM |
Rules and Alerts: "run a script"? | discountvc | Outlook | 0 | 06-15-2010 07:36 AM |
An "error has occurred in the script on this page" | decann | Outlook | 8 | 09-03-2009 08:54 AM |