🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #232

Re: Where to cleanup an object instance

#232
From: Marc Rohloff TeamB
Date: Tue, 25 Jul 2006 22:11
15 lines
1723 bytes
On Tue, 25 Jul 2006 20:48:44 +0200, Francois PIETTE [ICS - MidWare]
wrote:

> I'm porting Delphi code to C#.
> In a Delphi class, you cleanup a class instance from the destructor. But in
> C#, there is no destructor.

Generally you want to implement a finalizer and the IDisposable
interface. Its a little tricky to do it correctly but if you do a web
search on the IDisposable pattern you should find plenty of good
resources.

-- 
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Technical Details
Message-ID: <1314sxx1p3xv.dlg@dlg.marcrohloff.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <44c66807@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,57d58bae5e2b1da0
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Marc Rohloff [TeamB]" <"on request">
Subject: Re: Where to cleanup  an object instance
Newsgroups: borland.public.csharpbuilder.language.csharp
User-Agent: 40tude_Dialog/2.0.15.1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
References: <44c66807@newsgroups.borland.com>
Date: Tue, 25 Jul 2006 18:11:29 -0400
Message-ID: <1314sxx1p3xv.dlg@dlg.marcrohloff.com>
X-Face: "huzh55Xi]!ZNni78>a*5+).`SK?<^q2MlHk-C]Z2M9T@\J5ZCB$95Ey+s"XQuhGFA[eutZ :0^AV!Q;t>gE`1-=8d;HZ6~*o1dH<X9\b$!|(}+I'!Xq)@3Op}%0ArW&nf'Qh*EwR
X-Antivirus: avast! (VPS 0630-1, 07/24/2006), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 65.31.1.121
X-Trace: newsgroups.borland.com 1153865488 65.31.1.121 (25 Jul 2006 15:11:28 -0700)
Lines: 15
X-Authenticated-User: mrohloff
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail