i had another bug in my app caused by careless usage of Delphi interfaces. When i pass an interface to a procedure which ignores that argument, the instance is never freed. See
It is a different manifestation of the bugs here.
I will add this to the QC report.
This does not reproduce in Delphi XE update 1 any more.
--jeroen
Add a guid to you ITest declaration
ITest = interface
['{DB6637F9-FAD3-4765-9EC1-0A374AAC7469}']
procedure Test;
end;
Change the loop to this
for x in list do
x.UseTestOrNot(Tester.Create as ITest);
The GUID is neccesary to be able to use as
Test.Create as ITest
makes the compiler to add the release where the created object goes out of scope.