Nat Luengnaruemitchai

Geek Blog

  Home  |   Contact  |   Syndication    |   Login
  93 Posts | 0 Stories | 141 Comments | 243 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?
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 Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: 
Please add 4 and 7 and type the answer here: