瀏覽代碼

Reset class fields FList and FHashList to nil after Destroy call

git-svn-id: trunk@34078 -
pierre 9 年之前
父節點
當前提交
b3063b7db2
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      compiler/cclasses.pas

+ 3 - 1
compiler/cclasses.pas

@@ -619,7 +619,7 @@ implementation
                 move (b^, s[1],l*SizeOf(char));
                 move (b^, s[1],l*SizeOf(char));
               l:=length(Strings);
               l:=length(Strings);
               setlength(Strings,l+1);
               setlength(Strings,l+1);
-              Strings[l]:=S;  
+              Strings[l]:=S;
               inc (result);
               inc (result);
             end;
             end;
         end;
         end;
@@ -1027,6 +1027,7 @@ begin
   begin
   begin
     Clear;
     Clear;
     FList.Destroy;
     FList.Destroy;
+    FList:=nil;
   end;
   end;
   inherited Destroy;
   inherited Destroy;
 end;
 end;
@@ -1842,6 +1843,7 @@ begin
     begin
     begin
       Clear;
       Clear;
       FHashList.Destroy;
       FHashList.Destroy;
+      FHashList:=nil;
     end;
     end;
   inherited Destroy;
   inherited Destroy;
 end;
 end;