diff options
author | Michael Kinney <michaelakinney@comcast.net> | 2021-02-12 17:01:19 -0500 |
---|---|---|
committer | Michael Kinney <michaelakinney@comcast.net> | 2021-02-12 17:01:19 -0500 |
commit | 9d8931eccf781ce7bf4ce91db332bf9b7796b720 (patch) | |
tree | afdc7a415302b868018035addfc7d5ce0a8c3168 | |
parent | aef11aca68bbf90e4d4f443f75f31a575ccce828 (diff) | |
download | sdl_ios-9d8931eccf781ce7bf4ce91db332bf9b7796b720.tar.gz |
must wait until done to ensure eassesion closure on dealloc
-rw-r--r-- | SmartDeviceLink/private/SDLIAPSession.m | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/SmartDeviceLink/private/SDLIAPSession.m b/SmartDeviceLink/private/SDLIAPSession.m index 1e0827086..ff12b7e22 100644 --- a/SmartDeviceLink/private/SDLIAPSession.m +++ b/SmartDeviceLink/private/SDLIAPSession.m @@ -6,6 +6,7 @@ #import "SDLLogMacros.h" #import "SDLMutableDataQueue.h" #import "SDLTimer.h" +#import "SDLACVLLogging.h" NS_ASSUME_NONNULL_BEGIN @@ -47,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN - (void) dealloc { if (self.eaSession != nil) { - [self closeSession]; + [self performSelector:@selector(peformCloseSession) onThread:self.sessionThread withObject:nil waitUntilDone:YES]; } } @@ -225,7 +226,7 @@ NS_ASSUME_NONNULL_BEGIN /** * Called when the session gets a `NSStreamEventEndEncountered` event code. The current session is closed and a new session is attempted. */ -- (void)streamDidEnd:(NSStream *)stream { +- (void)streamDidEnd:(NSStream *)stream { [self closeSession]; if (self.iAPSessionDelegate != nil) { [self.iAPSessionDelegate streamsDidEnd]; @@ -301,5 +302,3 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END - - |