mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
74187657e5
commit
c0b169e0a3
1 changed files with 11 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue