Hi I have a program that creates a TInterfacedObject and nothing else. program project1;…
In our previous episode, Juha Manninen (gmail) said:
Show quoted text 7 lines
io: IUnknown;begin io := TInterfacedObject.Create; end.
Try the above program.
If I add "io.free" then there are no unfreed memory blocks. Now, I have understood interfaced objects are reference counted and freed automatically. Is this a bug or did I understand it wrong?
Yes you understood it wrong. The interface references are reference counted, the object references don't suddenly become ref-counted.
It is a common trap though.
