diff options
author | David Switzer <dswitzer@xevo.com> | 2017-05-01 10:35:43 -0700 |
---|---|---|
committer | David Switzer <dswitzer@xevo.com> | 2017-05-01 10:35:43 -0700 |
commit | c15c214238d9f30dd74b03470b3207e299e2acac (patch) | |
tree | 0a86d52d20be93f7cf820fdec37b9c1b24bfc1b3 | |
parent | a24bdb5994490bcf8f8eb84c455bd6dd880d791f (diff) | |
download | sdl_ios-c15c214238d9f30dd74b03470b3207e299e2acac.tar.gz |
Incorporate additional PR feedback into SDLIAPSession class
-rw-r--r-- | SmartDeviceLink/SDLIAPSession.m | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/SmartDeviceLink/SDLIAPSession.m b/SmartDeviceLink/SDLIAPSession.m index 781398c0f..5405699df 100644 --- a/SmartDeviceLink/SDLIAPSession.m +++ b/SmartDeviceLink/SDLIAPSession.m @@ -200,6 +200,7 @@ NSTimeInterval const streamThreadWaitSecs = 1.0; - (void)startStream:(NSStream *)stream { stream.delegate = self.streamDelegate; + NSAssert((self.isDataSession && [[NSThread currentThread] isEqual:self.ioStreamThread]) || [NSThread isMainThread], @"startStream is being called on the wrong thread!!!"); [stream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; [stream open]; } @@ -210,6 +211,8 @@ NSTimeInterval const streamThreadWaitSecs = 1.0; // When you disconect the cable you get a stream end event and come here but stream is already in closed state. // Still need to remove from run loop. + + NSAssert((self.isDataSession && [[NSThread currentThread] isEqual:self.ioStreamThread]) || [NSThread isMainThread], @"startStream is being called on the wrong thread!!!"); NSUInteger status1 = stream.streamStatus; if (status1 != NSStreamStatusNotOpen && @@ -285,16 +288,4 @@ NSTimeInterval const streamThreadWaitSecs = 1.0; }; } -#pragma mark - Lifecycle Destruction - -- (void)dealloc { - self.sendDataQueue = nil; - self.delegate = nil; - self.accessory = nil; - self.protocol = nil; - self.streamDelegate = nil; - self.easession = nil; - [SDLDebugTool logInfo:@"SDLIAPSession Dealloc"]; -} - @end |