|
-
Apr 1st, 2004, 10:05 AM
#1
Thread Starter
Frenzied Member
disposing of a class
I've got a form that is declared as NEW at some point in my program. it has a list view and after the user selects something, the form closes itself (me.close).
the form is declared as MC = new formasdasd by the way.
after it closes itself, would the sub that instantiated it be responsible for destroying MC? or, could I code a custom 'dispose' property and when the 'closing' event is fired, have the dispose go into action?
-
Apr 1st, 2004, 10:11 AM
#2
Junior Member
Implement the IDisposable interface in your form and do your own dispose... I read somewhere that this is recommended...
Seriously, I never really cared about disposing of my forms when they close because the real memory free happens when the garbage collector collects your closed form... and you never know when this will happen...
-
Apr 1st, 2004, 11:29 AM
#3
Thread Starter
Frenzied Member
hmm. ok. but, just simply closing the form takes it out of memory EVENTUALLY? I just don't want a ton of new instances of the form piling up in the stack and my app to start getting sluggish.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|