diff options
author | David Switzer <dswitzer@xevo.com> | 2017-07-10 15:24:24 -0700 |
---|---|---|
committer | David Switzer <dswitzer@xevo.com> | 2017-07-18 10:28:36 -0700 |
commit | dc0dc7e4ff00fe986c07473bab67a34ce58fd12c (patch) | |
tree | 93d82865edfbb6b84cd8938225eacba6e7936ca4 | |
parent | 8edc4d6a3153bfe9bd26150f0656707662347abe (diff) | |
download | sdl_ios-dc0dc7e4ff00fe986c07473bab67a34ce58fd12c.tar.gz |
Move control session teardown to SDLIAPTransport disconnect.
-rw-r--r-- | SmartDeviceLink/SDLIAPTransport.m | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/SmartDeviceLink/SDLIAPTransport.m b/SmartDeviceLink/SDLIAPTransport.m index 88d380133..5d8585c11 100644 --- a/SmartDeviceLink/SDLIAPTransport.m +++ b/SmartDeviceLink/SDLIAPTransport.m @@ -141,10 +141,16 @@ int const streamOpenTimeoutSeconds = 2; // Stop event listening here so that even if the transport is disconnected by the proxy // we unregister for accessory local notifications [self sdl_stopEventListening]; - // Only disconnect the data session, the control session does not stay open and is handled separately - if (self.session != nil) { - [self.session stop]; - self.session = nil; + if (self.controlSession) { + [self.controlSession.streamDelegate clearHandlers]; + self.controlSession.streamDelegate = nil; + [self.controlSession stop]; + } else { + if (self.session != nil) { + [self.session.streamDelegate clearHandlers]; + self.session.streamDelegate = nil; + [self.session stop]; + } } } |