Browse Source

* Fix memleak when using packages

git-svn-id: trunk@48082 -
(cherry picked from commit 7adcd2a8a27ff89558856756c8f7abd002623d88)
michael 4 years ago
parent
commit
d15b32f4a2
1 changed files with 3 additions and 0 deletions
  1. 3 0
      packages/fcl-passrc/src/pparser.pp

+ 3 - 0
packages/fcl-passrc/src/pparser.pp

@@ -3142,7 +3142,10 @@ begin
       FinishedModule;
       FinishedModule;
   finally
   finally
     if HasFinished then
     if HasFinished then
+      begin
+      Module.Release{$IFDEF CheckPasTreeRefCount}('TPasPackage.Modules'){$ENDIF};
       FCurModule:=nil; // clear module if there is an error or finished parsing
       FCurModule:=nil; // clear module if there is an error or finished parsing
+      end;
   end;
   end;
 end;
 end;