PC Review


Reply
Thread Tools Rate Thread

Destructor question

 
 
Keith Smith
Guest
Posts: n/a
 
      14th Feb 2005
I was reading this link which mentions destructors...

http://www.csharp-station.com/Tutorials/Lesson07.aspx

Could someone give a simple example of practical useful destructor code?
Would you want to use something like this??

x=null;


 
Reply With Quote
 
 
 
 
=?Utf-8?B?R3JlZw==?=
Guest
Posts: n/a
 
      14th Feb 2005
Since the Garbage Collector collects only managed code garbage, you want to
use the destructor to clean up any unmanaged code items. For example, you
may want to close database connections.

Greg

"Keith Smith" wrote:

> I was reading this link which mentions destructors...
>
> http://www.csharp-station.com/Tutorials/Lesson07.aspx
>
> Could someone give a simple example of practical useful destructor code?
> Would you want to use something like this??
>
> x=null;
>
>
>

 
Reply With Quote
 
=?Utf-8?B?QW5zaWwgTUNBRA==?=
Guest
Posts: n/a
 
      14th Feb 2005
hi ,
check these article

http://www.codeproject.com/csharp/DestructorsInCs.asp

http://www.codeproject.com/csharp/IDispose.asp
regards
Ansil

"Keith Smith" wrote:

> I was reading this link which mentions destructors...
>
> http://www.csharp-station.com/Tutorials/Lesson07.aspx
>
> Could someone give a simple example of practical useful destructor code?
> Would you want to use something like this??
>
> x=null;
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
destructor =?Utf-8?B?Q2hyaXN0aWFuIEhhdmVs?= Microsoft C# .NET 3 13th Mar 2007 07:38 PM
destructor behaviour Servé La Microsoft C# .NET 1 21st Jan 2005 09:43 AM
Destructor - ?? =?Utf-8?B?Q2hyaXN0b3BoZXI=?= Microsoft Dot NET Framework 6 7th Dec 2004 11:55 PM
Why not destructor? =?Utf-8?B?U2hhcm9u?= Microsoft C# .NET 11 24th Nov 2004 03:23 PM
Destructor and garbagecollector Peter Hemmingsen Microsoft VC .NET 13 25th Jun 2004 02:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:35 AM.