[DUG] A change in upgrade policy coming from Embarcadero

John Bird johnkbird at paradise.net.nz
Fri Sep 18 17:29:43 NZST 2009


As far as Garbage collection in Delphi, I have sometimes wondered why there 
isn't something along the lines of a RTTI list of objects that have been 
created by the program in code (rather than autocreated by the Application), 
then it would be quite easy to go thru the list and figure out anything 
which needs to be freed, and hasn't been yet.

With that you would have much of the features of a garbage collection, or at 
least an easy way for the programmer to work out what they forgot to free or 
never actually got freed..

Oh wait there probably is somewhere....anyone know?   (You can tell I don't 
create and free objects that much, in part to avoid extra complexity).

something along the lines of  (frantically inventing code - I am already 
used to interating thru components on a form)

comp:TComponent;        //parent form

        for compptr := 0 to comp.ComponentCount - 1 do
        begin
         if (comp.components[compptr].assigned) and 
(comp.components[compptr].LastUse < FiveMinsAgo)
        then (comp.components[compptr].free)


And because its friday...

"%20       The Final Frontier..."

John 




More information about the Delphi mailing list