|
-
Jun 19th, 2006, 02:09 PM
#1
Thread Starter
Member
[2.0] Self-destructing class?
Is it possible for a class to essentially set itself to null? I need someway to run a function on a class and have it terminate right after.
Running into infinite loop problem, and I figured out why.. i need to destroy the class when i'm done with it.
is it possible?
-
Jun 19th, 2006, 02:18 PM
#2
Re: [2.0] Self-destructing class?
Check out the IDispose interface. It provides a method that you can implement in order to cleanly reclaim all resources used by a class instance. Also see "Destructors" in MSDN.
I don't live here any more.
-
Jun 19th, 2006, 04:29 PM
#3
Re: [2.0] Self-destructing class?
Just set it to null when you're done with it?
-
Jun 19th, 2006, 05:35 PM
#4
Re: [2.0] Self-destructing class?
 Originally Posted by MasterEvilAce
Is it possible for a class to essentially set itself to null? I need someway to run a function on a class and have it terminate right after.
Running into infinite loop problem, and I figured out why.. i need to destroy the class when i'm done with it.
is it possible?
Implement IDisposable interface and use your class with "using" keyword
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
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
|