mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
Workaround for missing disconnected signals on Windows
Sometimes Qt doesn't emit a disconnected signal for closed sockets (or it happens before we're listening to those). Manually emitting the signal in our disconnect function if the socket is not connected fixes the problem.
This commit is contained in:
parent
87376a937c
commit
eb291db1c8
@ -214,6 +214,11 @@ void Connection::forceFlush() {
|
||||
}
|
||||
|
||||
void Connection::disconnectSocket(bool force) {
|
||||
if (qtsSocket->state() == QAbstractSocket::UnconnectedState) {
|
||||
emit connectionClosed(QAbstractSocket::UnknownSocketError, QString());
|
||||
return;
|
||||
}
|
||||
|
||||
if (force)
|
||||
qtsSocket->abort();
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user