Class and object persistence

  • Thread starter Thread starter James Neumann
  • Start date Start date
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.
 
It should go out of scope when the userform is closed. I would expect the
memory to be released at that point.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top