Ver código fonte

fcl-web: fixed crash in websocket server on windows when closing when already disconnected

mattias 3 anos atrás
pai
commit
eb17e6fd2d
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      packages/fcl-web/src/websocket/fpcustwsserver.pp

+ 2 - 1
packages/fcl-web/src/websocket/fpcustwsserver.pp

@@ -586,7 +586,8 @@ end;
 
 procedure TCustomWSServer.CloseConnectionSocket(aConnection: TWSServerConnection; var aContinue: boolean);
 begin
-  aConnection.ServerTransport.CloseSocket;
+  if aConnection.ServerTransport<>nil then
+    aConnection.ServerTransport.CloseSocket;
   aContinue:=True;
 end;