diff options
author | Claudiu Olteanu <olteanu.claudiu@ymail.com> | 2015-08-18 22:16:29 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-08-20 22:45:39 -0700 |
commit | c0b169e0a3b5e6d590ae750b6fa7bed961a1652a (patch) | |
tree | f80b905576dc60d71ea228c1f7682ee8398eb3f4 /qt-ui | |
parent | 74187657e5e1fb10dcc81c03f68b8e9d22d1ea70 (diff) | |
download | subsurface-c0b169e0a3b5e6d590ae750b6fa7bed961a1652a.tar.gz |
Wait for BTH device discovery thread to finish on stop call
We should wait for the WinBluetoothDeviceDiscoveryAgent completion
when the stop method was called.
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/btdeviceselectiondialog.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/qt-ui/btdeviceselectiondialog.cpp b/qt-ui/btdeviceselectiondialog.cpp index a5657c1b4..a257e249c 100644 --- a/qt-ui/btdeviceselectiondialog.cpp +++ b/qt-ui/btdeviceselectiondialog.cpp @@ -93,8 +93,12 @@ BtDeviceSelectionDialog::~BtDeviceSelectionDialog() delete localDevice; #endif // Clean the device discovery agent - if (remoteDeviceDiscoveryAgent->isActive()) + if (remoteDeviceDiscoveryAgent->isActive()) { remoteDeviceDiscoveryAgent->stop(); +#if defined(Q_OS_WIN) + remoteDeviceDiscoveryAgent->wait(); +#endif + } delete remoteDeviceDiscoveryAgent; } @@ -126,6 +130,9 @@ void BtDeviceSelectionDialog::on_save_clicked() if (remoteDeviceDiscoveryAgent->isActive()) { // Stop the SDP agent if the clear button is pressed and enable the Scan button remoteDeviceDiscoveryAgent->stop(); +#if defined(Q_OS_WIN) + remoteDeviceDiscoveryAgent->wait(); +#endif ui->scan->setEnabled(true); } @@ -142,6 +149,9 @@ void BtDeviceSelectionDialog::on_clear_clicked() if (remoteDeviceDiscoveryAgent->isActive()) { // Stop the SDP agent if the clear button is pressed and enable the Scan button remoteDeviceDiscoveryAgent->stop(); +#if defined(Q_OS_WIN) + remoteDeviceDiscoveryAgent->wait(); +#endif ui->scan->setEnabled(true); } } |