summaryrefslogtreecommitdiffstats
path: root/src/bluetooth
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2020-02-11 08:52:36 +0100
committerOliver Wolff <oliver.wolff@qt.io>2020-02-11 14:29:41 +0100
commit0bb394194aad69574b98de5b43da82b0f0a4a454 (patch)
tree19d29df7d864af666124aecb526e89c05742df73 /src/bluetooth
parentf4c68cb2fc894f1ff5a9271637d006095c2274d1 (diff)
winrt: Avoid possible hang in QBluetoothServer::hasPendingConnections
We have to unlock the mutex locker after the pending connection is handled in QBluetoothServerPrivate::handleClientConnection. Otherwise the application will hang, if the slot that is connected to QBluetoothServer::newConnection calls QBluetoothServer::hasPendingConnections as this functions also tries to lock the mutex. Fixes: QTBUG-81827 Change-Id: I40632d0c1e4a6cf4436f6471e5a0933c53dda9f1 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/bluetooth')
-rw-r--r--src/bluetooth/qbluetoothserver_winrt.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothserver_winrt.cpp b/src/bluetooth/qbluetoothserver_winrt.cpp
index b9d98eb7..884f2285 100644
--- a/src/bluetooth/qbluetoothserver_winrt.cpp
+++ b/src/bluetooth/qbluetoothserver_winrt.cpp
@@ -141,6 +141,7 @@ HRESULT QBluetoothServerPrivate::handleClientConnection(IStreamSocketListener *l
if (pendingConnections.count() < maxPendingConnections) {
qCDebug(QT_BT_WINRT) << "Accepting connection";
pendingConnections.append(socket);
+ locker.unlock();
q->newConnection();
} else {
qCDebug(QT_BT_WINRT) << "Refusing connection";