Răsfoiți Sursa

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

git-svn-id: trunk@39325 -
michael 7 ani în urmă
părinte
comite
398ab09c8d
1 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  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