[DUG] Related try..finally question

Conor Boyd Conor.Boyd at trimble.co.nz
Fri Jul 21 15:26:10 NZST 2006


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.



More information about the Delphi mailing list