Quote Originally Posted by chronozphere
Hmm.. i'm not sure how you would distinguish classes and objects in this matter. Do you mean classtypes? :?
Both Free Pascal and Delphi support the old Turbo Pascal object model that is defined using txx = object(tparent)
end;

objects are auto-freed (they are static objects, record like for allocation purposes) but not auto-destructed. They don't have an official destructor in the first place.

AFAIK, It's all as follows:

Strings and records are automaticly freed.
Pointers (pointing to data) and Objects are NOT automaticly freed.

I don't know for sure about interfaces, but i guess their refcount wil decrement automaticly when they are freed/finalized.
That's the whole point. The dyn array contents are not freed, but finalized. For automated types ( e.g. interface/strings/dyn arrays/variants) this means decreasing ref count, and can _lead_ deallocate if necessary.

This is exactly the same as for e.g. local variables.