Browse Source

* Fixed some AV's

git-svn-id: trunk@8030 -
joost 18 years ago
parent
commit
86823a8c86
1 changed files with 5 additions and 5 deletions
  1. 5 5
      packages/fcl-web/src/fphtml.pp

+ 5 - 5
packages/fcl-web/src/fphtml.pp

@@ -228,11 +228,11 @@ begin
       result := el.asstring;
       result := el.asstring;
     finally
     finally
       if WCreated then
       if WCreated then
-        FWriter.Free;
+        FreeAndNil(FWriter);
     end;
     end;
   finally
   finally
     if created then
     if created then
-      FDocument.Free;
+      FreeAndNil(FDocument);
   end;
   end;
 end;
 end;
 
 
@@ -419,7 +419,7 @@ Var
   M : TMemoryStream;
   M : TMemoryStream;
   
   
 begin
 begin
-  CreateDocument;
+  FDocument := CreateDocument;
   Try
   Try
     FWriter:=CreateWriter(FDocument);
     FWriter:=CreateWriter(FDocument);
     Try
     Try
@@ -435,10 +435,10 @@ begin
         end;
         end;
       FDocument.SaveToStream(AResponse.ContentStream);
       FDocument.SaveToStream(AResponse.ContentStream);
     Finally
     Finally
-      FWriter.Free;
+      FreeAndNil(FWriter);
     end;
     end;
   Finally
   Finally
-    FDocument.Free;
+    FreeAndNil(FDocument);
   end;
   end;
 end;
 end;