diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-05-22 14:58:48 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-27 12:59:10 +0200 |
commit | 19f10aae3d333ef6486ea1390998f0674fd4d89e (patch) | |
tree | 716c07b78e68fe76c78bd2a20deed3d8425f0f18 /src/bluetooth/qbluetoothlocaldevice.cpp | |
parent | d4537ea1e887510cce1d42437b92f26b52e30d71 (diff) |
Bluez4: Ensure QBluetoothLocalDevice becomes invalid if adapter disappears
The DBus object disappears when the dongle is removed. Once a
QBluetoothLocalDevice instance is invalid it remains invalid.
The patch further ensures that an invalid instance does not
initiate pairing activitiy.
Last but not least this patch fixes a memory leak in case
a DBus error occurs during the adapter initialization.
Task-number: QTBUG-38399
Change-Id: I2e13e393060c77fab5f79d5451dd6fe9a2a6e3bb
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
Diffstat (limited to 'src/bluetooth/qbluetoothlocaldevice.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothlocaldevice.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice.cpp b/src/bluetooth/qbluetoothlocaldevice.cpp index 14140846..6560e135 100644 --- a/src/bluetooth/qbluetoothlocaldevice.cpp +++ b/src/bluetooth/qbluetoothlocaldevice.cpp @@ -125,8 +125,16 @@ QBluetoothLocalDevice::~QBluetoothLocalDevice() } /*! - Returns true if the QBluetoothLocalDevice represents an available local Bluetooth device; + Returns \c true if the QBluetoothLocalDevice represents an available local Bluetooth device; otherwise return false. + + If the local Bluetooth adapter represented by an instance of this class + is removed from the system (e.g. removal of the underlying Bluetooth dongle) + then this instance will become invalid. An already invalid QBluetoothLocalDevice instance + remains invalid even if the same Bluetooth adapter is returned to + the system. + + \sa allDevices() */ bool QBluetoothLocalDevice::isValid() const { |