deadlock fix
This commit is contained in:
parent
733aa6c52b
commit
2e06b95e5c
1 changed files with 4 additions and 1 deletions
|
@ -72,7 +72,10 @@ ServerSocketInterface::ServerSocketInterface(Servatrice *_server, Servatrice_Dat
|
|||
socket->setSocketOption(QAbstractSocket::LowDelayOption, 1);
|
||||
connect(socket, SIGNAL(readyRead()), this, SLOT(readClient()));
|
||||
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(catchSocketError(QAbstractSocket::SocketError)));
|
||||
connect(this, SIGNAL(outputQueueChanged()), this, SLOT(flushOutputQueue()));
|
||||
|
||||
// Never call flushOutputQueue directly from outputQueueChanged. In case of a socket error,
|
||||
// it could lead to this object being destroyed while another function is still on the call stack. -> mutex deadlocks etc.
|
||||
connect(this, SIGNAL(outputQueueChanged()), this, SLOT(flushOutputQueue()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
ServerSocketInterface::~ServerSocketInterface()
|
||||
|
|
Loading…
Reference in a new issue