summaryrefslogtreecommitdiff
path: root/libsowatchbt/bluetoothwatch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsowatchbt/bluetoothwatch.cpp')
-rw-r--r--libsowatchbt/bluetoothwatch.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libsowatchbt/bluetoothwatch.cpp b/libsowatchbt/bluetoothwatch.cpp
index 38ec4d4..d8a2451 100644
--- a/libsowatchbt/bluetoothwatch.cpp
+++ b/libsowatchbt/bluetoothwatch.cpp
@@ -165,6 +165,9 @@ void BluetoothWatch::handleSocketDisconnected()
void BluetoothWatch::handleSocketError(QBluetoothSocket::SocketError error)
{
qWarning() << "Socket error:" << error;
+ if (_socket) {
+ _socket->close();
+ }
// Seems that sometimes a disconnection event may not be generated.
handleSocketDisconnected();
}