Don't create thread on failed connection
Differential revision: D4545 Fixes: #6442 This was SVN commit r26649.
This commit is contained in:
parent
cce1005c81
commit
8cec96270b
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2022 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@ -201,6 +201,7 @@ bool CNetClient::SetupConnection(ENetHost* enetClient)
|
||||
CNetClientSession* session = new CNetClientSession(*this);
|
||||
bool ok = session->Connect(m_ServerAddress, m_ServerPort, enetClient);
|
||||
SetAndOwnSession(session);
|
||||
if (ok)
|
||||
m_PollingThread = std::thread(Threading::HandleExceptions<CNetClientSession::RunNetLoop>::Wrapper, m_Session);
|
||||
return ok;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user