QuickLib
QuickLib copied to clipboard
Access violation destroying TIocContainer
You can reproduce the issue simply running the QuickIOC demo: an exception is thrown when "iocContainer.Free" is called.
Maybe the issue is related to the following line (module "Quick.IOC.pas", destructor TIocRegistrator.Destroy):
if (fDependencyOrder[i] is TIocRegistrationInstance) and (TIocRegistrationInstance(fDependencyOrder[i]).IsSingleton) then TIocRegistrationInstance(regs[i]).Instance.Free;
Since if it is replaced by the follwing, apparently the problem disappears:
if (fDependencyOrder[i] is TIocRegistrationInstance) and (TIocRegistrationInstance(fDependencyOrder[i]).IsSingleton) then TIocRegistrationInstance(fDependencyOrder[i]).Instance.Free;
Best regards,