mirror of
https://github.com/glest/glest-source.git
synced 2025-08-27 09:54:26 +02:00
- added extra mutex guard when closing connection slots to try to fix parallel close connections from causing errors.
This commit is contained in:
@@ -806,10 +806,15 @@ void ConnectionSlot::close() {
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||
MutexSafeWrapper safeMutex(&mutexCloseConnection,mutexOwnerId);
|
||||
|
||||
bool updateServerListener = (socket != NULL);
|
||||
delete socket;
|
||||
socket= NULL;
|
||||
|
||||
safeMutex.ReleaseLock();
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s LINE: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
if(updateServerListener == true && ready == false) {
|
||||
|
@@ -112,6 +112,8 @@ private:
|
||||
time_t connectedTime;
|
||||
bool gotIntro;
|
||||
|
||||
Mutex mutexCloseConnection;
|
||||
|
||||
Mutex mutexPendingNetworkCommandList;
|
||||
vector<NetworkCommand> vctPendingNetworkCommandList;
|
||||
ConnectionSlotThread* slotThreadWorker;
|
||||
|
Reference in New Issue
Block a user