From 9f043f4a933485de8dccff0e0d50fd0666b1af38 Mon Sep 17 00:00:00 2001 From: Claudiu Olteanu Date: Tue, 18 Aug 2015 20:11:25 +0300 Subject: Cleanup Bluetooth local device and the discovery agent on exit Do some extra cleanup when the BtDeviceSelectionDialog is destroyed. Signed-off-by: Claudiu Olteanu Signed-off-by: Dirk Hohndel --- qt-ui/btdeviceselectiondialog.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qt-ui/btdeviceselectiondialog.cpp b/qt-ui/btdeviceselectiondialog.cpp index 007fe940e..ce759ccba 100644 --- a/qt-ui/btdeviceselectiondialog.cpp +++ b/qt-ui/btdeviceselectiondialog.cpp @@ -61,6 +61,15 @@ BtDeviceSelectionDialog::BtDeviceSelectionDialog(QWidget *parent) : BtDeviceSelectionDialog::~BtDeviceSelectionDialog() { delete ui; + + // Clean the local device + delete localDevice; + + // Clean the device discovery agent + if (remoteDeviceDiscoveryAgent->isActive()) + remoteDeviceDiscoveryAgent->stop(); + + delete remoteDeviceDiscoveryAgent; } void BtDeviceSelectionDialog::on_changeDeviceState_clicked() -- cgit v1.2.3-70-g09d2