Procházet zdrojové kódy

Fix AV in IOC for Singleton non-interfaced class

A non-interfaced class registered in the IOC as Singleton, was raising an AV when the container was freed
jkour před 2 roky
rodič
revize
2bb48614b9
2 změnil soubory, kde provedl 69 přidání a 15 odebrání
  1. 3 1
      Quick.IOC.pas
  2. 66 14
      samples/delphi/QuickIOC/IOCdemo.dproj

+ 3 - 1
Quick.IOC.pas

@@ -442,7 +442,9 @@ begin
     if fDependencyOrder[i] <> nil then
     begin
       //free singleton instances not interfaced
-      if (fDependencyOrder[i] is TIocRegistrationInstance) and (TIocRegistrationInstance(fDependencyOrder[i]).IsSingleton) then TIocRegistrationInstance(regs[i]).Instance.Free;
+      if (fDependencyOrder[i] is TIocRegistrationInstance) and
+          (TIocRegistrationInstance(fDependencyOrder[i]).IsSingleton) then
+            TIocRegistrationInstance(fDependencyOrder[i]).Instance.Free;
       fDependencyOrder[i].Free;
     end;
   end;

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 66 - 14
samples/delphi/QuickIOC/IOCdemo.dproj


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů