summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2020-10-06 14:18:53 -0400
committerJoel Fischer <joeljfischer@gmail.com>2020-10-06 14:18:53 -0400
commit0bf0d386ab041654f69f32b474c5fe4e1f8d2c07 (patch)
tree3b4c4397e540e4cc1b0960f205b0ab8554b4d717
parent924c510363f406ba3527458e9e13581a4890b6f7 (diff)
downloadsdl_ios-bugfix/issue-1799-high-cpu.tar.gz
-rw-r--r--SmartDeviceLink/private/SDLIAPDataSession.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/SmartDeviceLink/private/SDLIAPDataSession.m b/SmartDeviceLink/private/SDLIAPDataSession.m
index 785573fde..d44ea3a82 100644
--- a/SmartDeviceLink/private/SDLIAPDataSession.m
+++ b/SmartDeviceLink/private/SDLIAPDataSession.m
@@ -333,7 +333,11 @@ NS_ASSUME_NONNULL_BEGIN
while (self.ioStreamThread != nil && !self.ioStreamThread.cancelled) {
// Enqueued data will be written to and read from the streams in the runloop
- [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.25f]];
+ BOOL result = [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.25f]];
+ if (!result) {
+ SDLLogE(@"The run loop returned a failure even though the input and output streams should be attached. Input stream: %@ Output stream: %@ Accessory: %@", self.eaSession.inputStream, self.eaSession.outputStream, self.accessory);
+ break;
+ }
}
SDLLogD(@"Closing the accessory event loop on thread: %@", NSThread.currentThread.name);