From c3392e5d539e87f4720b3d107aaefffdc9579f4d Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Mon, 13 May 2013 01:41:28 +0200 Subject: close the socket during a bluetooth error --- libsowatchbt/bluetoothwatch.cpp | 3 +++ 1 file changed, 3 insertions(+) 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(); } -- cgit v1.2.3