Nat Luengnaruemitchai

Geek Blog

  Home  |   Contact  |   Syndication    |   Login
  100 Posts | 0 Stories | 300 Comments | 232 Trackbacks

News

Archives

Post Categories

Blogroll

Sometimes, I have to connect to unmanaged system in which I have to initialize something at the beginning and need to clean up at the end. In this case, instead of writing a singleton class that have a finalizer, can't I have a class destructor to do this job?
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Wednesday, April 27, 2005 1:32 AM

Feedback

# re: C# IAQ #5: Why C# Doesn't Have Class Destructor? 12/8/2006 2:29 PM Rude
can you implement the IDispose interface, and put the calling to unmanaged resource into a Using clause, this way when the code goes out of the Using clause, the dispose method is automatically called by GC

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: