summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2019-02-08 12:53:58 +0100
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2019-02-08 12:20:30 +0000
commitd41eaba6fb19350d51e6487440af13ac4320f46e (patch)
treede191c2485c9354b7e7a21905ed940590d0b20f1
parent7accd34495a8269f9b335446ae779bd56cd4c4c0 (diff)
Fix potential bug in osxbtcentralmanager
Similar to the problem found in osxbtleinquiry - 'timers' waiting to fire on "qt-LE-queue" know nothing about us, potentially deleting the delegate object in response to Bluetooth switched off. Task-number: QTBUG-73140 Change-Id: I1a39a1ca02d019f90a1b4214cdbbb76e26b9eea0 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/bluetooth/osx/osxbtcentralmanager.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bluetooth/osx/osxbtcentralmanager.mm b/src/bluetooth/osx/osxbtcentralmanager.mm
index cadabbaf..41713909 100644
--- a/src/bluetooth/osx/osxbtcentralmanager.mm
+++ b/src/bluetooth/osx/osxbtcentralmanager.mm
@@ -1245,6 +1245,7 @@ QT_USE_NAMESPACE
if (notifier)
emit notifier->CBManagerError(QLowEnergyController::InvalidBluetoothAdapterError);
}
+ [self stopWatchers];
return;
}
@@ -1266,6 +1267,7 @@ QT_USE_NAMESPACE
if (notifier)
emit notifier->CBManagerError(QLowEnergyController::InvalidBluetoothAdapterError);
}
+ [self stopWatchers];
return;
}
@@ -1280,7 +1282,7 @@ QT_USE_NAMESPACE
}
} else {
// We actually handled all known states, but .. Core Bluetooth can change?
- Q_ASSERT_X(0, Q_FUNC_INFO, "invalid centra's state");
+ Q_ASSERT_X(0, Q_FUNC_INFO, "invalid central's state");
}
#pragma clang diagnostic pop