Explorar el Código

* Clear request/response variables in case of an error

git-svn-id: trunk@25179 -
michael hace 12 años
padre
commit
db0585f388
Se han modificado 1 ficheros con 7 adiciones y 4 borrados
  1. 7 4
      packages/fcl-web/src/base/custhttpapp.pp

+ 7 - 4
packages/fcl-web/src/base/custhttpapp.pp

@@ -219,10 +219,13 @@ procedure TFPHTTPServerHandler.HTTPHandleRequest(Sender: TObject;
   var AResponse: TFPHTTPConnectionResponse);
 begin
   // Exceptions are handled by (Do)HandleRequest. It also frees the response/request
-  DoHandleRequest(ARequest,AResponse);
-  ARequest:=Nil;
-  AResponse:=Nil;
-  If Terminated then
+  try
+    DoHandleRequest(ARequest,AResponse);
+  finally  
+    ARequest:=Nil;
+    AResponse:=Nil;
+  end;    
+  If Terminated And Assigned(FServer) then
     FServer.Active:=False;
   if Assigned(OnIdle) then
     OnIdle(Self);