You DO NOT need to disconnect active clients manually before deactivating the server. The
TIdTCPServer.Active property setter will handle that internally for you. So, just deactivate the server normally, let Indy do the rest.
Procedure Tf_main.disconnectTCP();
begin
IdTCPSERVER.OnDisconnect := nil;
IdTCPSERVER.Active := false;
end;