Class and object persistence

J

James Neumann

This is really a "good programming prcatice" question:

I have a userform, on which I instantiate a class, create a new
collection, and create a few objects - all in code. I've been pretty
careful to release any objects and destroy the instance of the class,
but what about the collection? Will the reference to this be released
in the unload event?

For reference, here's how I'm creating the collection:

'*********************************************************
Option Explicit

Dim collCtrl As New Collection

'A bunch of code...
'*********************************************************

Thanks,

JCN



Please remove NOSPAM to email, and please post any replies directly to
group.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
T

Tom Ogilvy

It should go out of scope when the userform is closed. I would expect the
memory to be released at that point.
 
J

James Neumann

Tom,

Thank you - one subject on which my ignorance is profound is VB garbage
collection!

JCN

Please remove NOSPAM to email, and please post any replies directly to
group.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Top