diff options
-rw-r--r-- | src/bluetooth/darwin/btconnectionmonitor.mm | 9 | ||||
-rw-r--r-- | src/bluetooth/darwin/btdeviceinquiry.mm | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/bluetooth/darwin/btconnectionmonitor.mm b/src/bluetooth/darwin/btconnectionmonitor.mm index 548fec9c..a9f038f5 100644 --- a/src/bluetooth/darwin/btconnectionmonitor.mm +++ b/src/bluetooth/darwin/btconnectionmonitor.mm @@ -89,6 +89,15 @@ using namespace QT_NAMESPACE; if (!device) return; + if (!monitor) { + // Rather surprising: monitor == nullptr means we stopped monitoring. + // So apparently this thingie is still alive and keeps receiving + // notifications. + qCWarning(QT_BT_DARWIN, + "Connection notification received in a monitor that was cancelled"); + return; + } + QT_BT_MAC_AUTORELEASEPOOL; // All Obj-C objects are autoreleased. diff --git a/src/bluetooth/darwin/btdeviceinquiry.mm b/src/bluetooth/darwin/btdeviceinquiry.mm index db8c778b..536db35d 100644 --- a/src/bluetooth/darwin/btdeviceinquiry.mm +++ b/src/bluetooth/darwin/btdeviceinquiry.mm @@ -158,11 +158,11 @@ const uint8_t IOBlueoothInquiryLengthS = 15; if (error != kIOReturnSuccess && !aborted) { // QtBluetooth has not too many error codes, 'UnknownError' is not really - // useful, report the actual error code here: + // useful, log the actual error code here: qCWarning(QT_BT_DARWIN) << "IOKit error code: " << error; - m_delegate->error(error); // Let watchDog to stop it, calling -stop at timeout, otherwise, - // it looks like inquiry continues and keeps reporting new devices found. + // it looks like inquiry continues even after this error and + // keeps reporting new devices found. } else { // Either a normal completion or from a timer slot. watchDog.reset(); |