Am 20.03.2013 15:35, schrieb Xiangrong Fang:
OK, What confused me is the description found in FPC manual saying:
TInterfacedObject is a descendent of TObject
<http://www.freepascal.org/docs-html/rtl/system/tobject.html> which
implements the IUnknown
<http://www.freepascal.org/docs-html/rtl/system/iunknown.html>
interface. It can be used as a base class for all classes which need
reference counting.
in another word, reference counting is a feature of TInterfacedObject,
or the AfterConstruction/BeforeDestruction methods?? it sounds like
non-descedants of TInterfacedObject are not reference counted??
No, the reference counting is a feature of IUnknown (or any descendant
of it) and is only used if you work with the interface and not the class
type. You can implement the IUnknown (or IInterface) interface yourself
as well.
Regards,
Sven
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus