diff options
| author | Javier S. Pedro <maemo@javispedro.com> | 2013-05-13 01:41:28 +0200 |
|---|---|---|
| committer | Javier S. Pedro <maemo@javispedro.com> | 2013-05-13 01:41:28 +0200 |
| commit | c3392e5d539e87f4720b3d107aaefffdc9579f4d (patch) | |
| tree | e5fd617739583cdcf6d3b2f89264cf822d7f9285 | |
| parent | 31e3450a84df7c1c64617299180813c975fbb877 (diff) | |
| download | sowatch-c3392e5d539e87f4720b3d107aaefffdc9579f4d.tar.gz sowatch-c3392e5d539e87f4720b3d107aaefffdc9579f4d.zip | |
close the socket during a bluetooth error
| -rw-r--r-- | libsowatchbt/bluetoothwatch.cpp | 3 |
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(); } |
