Browse Source

set FSocketInitialized to False in TSocketStream.Close (fix AV when Close is called twice)

Ondrej Pokorny 1 year ago
parent
commit
a518fb1fd5
1 changed files with 1 additions and 0 deletions
  1. 1 0
      packages/fcl-net/src/ssockets.pp

+ 1 - 0
packages/fcl-net/src/ssockets.pp

@@ -717,6 +717,7 @@ begin
   DoOnClose;
   if FSocketInitialized then
     FHandler.Close; // Ignore the result
+  FSocketInitialized:=False;
   FreeAndNil(FHandler);
   CloseSocket(Handle);
   FClosed:=True;