aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/btdeviceselectiondialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/btdeviceselectiondialog.cpp')
-rw-r--r--qt-ui/btdeviceselectiondialog.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/qt-ui/btdeviceselectiondialog.cpp b/qt-ui/btdeviceselectiondialog.cpp
index bd7ad1e3d..17ef634bb 100644
--- a/qt-ui/btdeviceselectiondialog.cpp
+++ b/qt-ui/btdeviceselectiondialog.cpp
@@ -8,7 +8,8 @@
BtDeviceSelectionDialog::BtDeviceSelectionDialog(QWidget *parent) :
QDialog(parent),
- ui(new Ui::BtDeviceSelectionDialog)
+ ui(new Ui::BtDeviceSelectionDialog),
+ remoteDeviceDiscoveryAgent(0)
{
ui->setupUi(this);
@@ -92,15 +93,17 @@ BtDeviceSelectionDialog::~BtDeviceSelectionDialog()
// Clean the local device
delete localDevice;
#endif
- // Clean the device discovery agent
- if (remoteDeviceDiscoveryAgent->isActive()) {
- remoteDeviceDiscoveryAgent->stop();
+ if (remoteDeviceDiscoveryAgent) {
+ // Clean the device discovery agent
+ if (remoteDeviceDiscoveryAgent->isActive()) {
+ remoteDeviceDiscoveryAgent->stop();
#if defined(Q_OS_WIN)
- remoteDeviceDiscoveryAgent->wait();
+ remoteDeviceDiscoveryAgent->wait();
#endif
- }
+ }
- delete remoteDeviceDiscoveryAgent;
+ delete remoteDeviceDiscoveryAgent;
+ }
}
void BtDeviceSelectionDialog::on_changeDeviceState_clicked()