Here is a code, that include Interface and implementation.
Can't figure out how to properly free object in this case.
Some suggestions would be appreciated.
As
rsz said, COM-style interfaces (the default) are reference counted. As you spezialize your
TGeneric<> with
ISomeInterface you simply need to do the following:
nothing. That's right, your destructor of
TGeneric<> can simply be empty. You also don't need to export
Free in
ISomeInterface (with COM-style interfaces that is a
really bad design as you've learned).