deadlock fix

This commit is contained in:
Max-Wilhelm Bruker 2013-01-09 22:28:49 +01:00
parent 733aa6c52b
commit 2e06b95e5c

View file

@ -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()