瀏覽代碼

* Fix bug ID #33885, correctly re-initialize parser when loading from stream

git-svn-id: trunk@39325 -
michael 7 年之前
父節點
當前提交
398ab09c8d
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      packages/fcl-base/src/csvdocument.pp

+ 4 - 4
packages/fcl-base/src/csvdocument.pp

@@ -404,14 +404,14 @@ begin
 end;
 
 procedure TCSVDocument.LoadFromStream(AStream: TStream);
+
 var
   I, J, MaxCol: Integer;
+
 begin
   Clear;
-
-  if not Assigned(FParser) then
-    FParser := TCSVParser.Create;
-
+  FreeAndNil(FParser);
+  FParser:=TCSVParser.Create;
   FParser.AssignCSVProperties(Self);
   with FParser do
   begin