fcl-web: TCustomWSServer.RemoveConnection: call DoDisconnect on disconnect

This commit is contained in:
mattias 2022-08-22 19:12:04 +02:00
parent 0b24d5f92e
commit 87857252a4

View File

@ -592,15 +592,14 @@ end;
procedure TCustomWSServer.RemoveConnection(AConnection: TWSServerConnection;aDoDisconnect: Boolean);
begin
if not aDoDisconnect then
DoDisconnect(aConnection)
else
if aDoDisconnect then
try
aConnection.Disconnect;
except
on E : Exception do
HandleError(aConnection,E);
end;
DoDisconnect(aConnection);
Connections.Remove(aConnection);
aConnection.Free;
end;