summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-05-13 01:41:28 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-05-13 01:41:28 +0200
commitc3392e5d539e87f4720b3d107aaefffdc9579f4d (patch)
treee5fd617739583cdcf6d3b2f89264cf822d7f9285
parent31e3450a84df7c1c64617299180813c975fbb877 (diff)
downloadsowatch-c3392e5d539e87f4720b3d107aaefffdc9579f4d.tar.gz
sowatch-c3392e5d539e87f4720b3d107aaefffdc9579f4d.zip
close the socket during a bluetooth error
-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();
}