[DUG] Related try..finally question

jamessugrue at xtra.co.nz jamessugrue at xtra.co.nz
Fri Jul 21 16:02:44 NZST 2006


Indeed. The only time you have to worry about disposing resources if you are using interopt assemblies (COM).


---- Conor Boyd <Conor.Boyd at trimble.co.nz> wrote: 
> I believe the .NET GC will cope with this situation.
> 
> If the only references to these two objects are to each other, than I
> think the GC will can them anyway.
> 
> C. 
> 
> -----Original Message-----
> From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz]
> On Behalf Of Todd Martin
> 
> You still need to worry about "loiterers" though.
> 
> eg. Object A refers to object B, which holds a reference back to object
> A. 
> Unless one of those references is explictly set to null, before objectA
> or object B goes out of scope, the objects are never garbage
> collected....a kind of memory leak!
> 
> ----- Original Message -----
> From: "James Sugrue" <jamessugrue at xtra.co.nz>
> 
> > Not that it applies too much to this example, but this is why I like
> C# 
> > and
> > the GC. Don't really have to worry about freeing objects. Only thing
> you
> > need to be concerned with is closing data connections and files.
> 
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi



More information about the Delphi mailing list