3 ms·
Delphi has legendary ARC not just with its VCL and object hierarchies with TOwner model but also with its wrappers of COM's IUnknown and QueryInterfaces. Yes of
by ak39 4y ago
Delphi has legendary ARC not just with its VCL and object hierarchies with TOwner model but also with its wrappers of COM's IUnknown and QueryInterfaces. Yes of course, developers can still make mistakes about sequences and memory management but a well constructed class hierarchy and discipline to manage the freeing of resources immediately after they're no longer needed is the cornerstone of basic Delphi applications.
edit: The objects that are IUnknown linked don't even need to be explicitly freed! There are several clever use cases for this for example changing TCursor from hourglass back to normal when a procedure/function is complete. It just works.