diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-01-26 08:47:06 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@theqtcompany.com> | 2015-01-29 09:32:08 +0000 |
commit | 9cc6a9b3af559004bbfdfec3aa7dd258bee1eb77 (patch) | |
tree | f632da853067c7dc01b134fb7ba8b0e4550e1d3d /src/bluetooth/qbluetoothservicediscoveryagent.h | |
parent | 4706708254176ca2b971a709697d0e8c77f55974 (diff) |
Fix crashing btchat example when selecting remote devicev5.4.1
The example immidiately destroys the QBluetoothServiceDiscoveryAgent
when the user selects a remote chat service from the remote selector
dialog. This may happen even when the scheduled QtConcurrent call
to runSdpScan() was still pending. The subsequent signal callback into
the deleted parent caused a crash.
Unfortunately QtConcurrent::run() returns a QFuture which does not
permit stopping the pending thread execution. Therefore the runSdpScan()
had to be rewritten using QProcess to properly destruct pending
calls.
Change-Id: I1ed5e147feb94a26240901a02d836056eddabbf6
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qbluetoothservicediscoveryagent.h')
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent.h b/src/bluetooth/qbluetoothservicediscoveryagent.h index 5e47ada0..b4f9d5f3 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent.h +++ b/src/bluetooth/qbluetoothservicediscoveryagent.h @@ -42,6 +42,10 @@ #include <QtBluetooth/QBluetoothUuid> #include <QtBluetooth/QBluetoothDeviceDiscoveryAgent> +#ifdef QT_BLUEZ_BLUETOOTH +#include <QtCore/qprocess.h> +#endif + QT_BEGIN_NAMESPACE class QBluetoothAddress; @@ -106,7 +110,7 @@ private: #ifdef QT_BLUEZ_BLUETOOTH Q_PRIVATE_SLOT(d_func(), void _q_discoveredServices(QDBusPendingCallWatcher*)) Q_PRIVATE_SLOT(d_func(), void _q_createdDevice(QDBusPendingCallWatcher*)) - Q_PRIVATE_SLOT(d_func(), void _q_finishSdpScan(QBluetoothServiceDiscoveryAgent::Error, const QString &, const QStringList &)) + Q_PRIVATE_SLOT(d_func(), void _q_sdpScannerDone(int,QProcess::ExitStatus)) #endif #ifdef QT_ANDROID_BLUETOOTH Q_PRIVATE_SLOT(d_func(), void _q_processFetchedUuids(const QBluetoothAddress &address, |