From 8737234d3e20b383916e4cd709216cb52323a3a7 Mon Sep 17 00:00:00 2001 From: yangjun Date: Wed, 1 Apr 2020 11:16:25 +0800 Subject: [PATCH 1/2] fix bug 1532 --- SmartDeviceLink/SDLLifecycleManager.m | 1 + SmartDeviceLink/SDLProxy.h | 3 +++ SmartDeviceLink/SDLProxy.m | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m index 53f2059ac..314ec1c0f 100644 --- a/SmartDeviceLink/SDLLifecycleManager.m +++ b/SmartDeviceLink/SDLLifecycleManager.m @@ -262,6 +262,7 @@ - (void)didEnterStateReconnecting { - (void)sdl_stopManager:(BOOL)shouldRestart { SDLLogV(@"Stopping manager, %@", (shouldRestart ? @"will restart" : @"will not restart")); + [self.proxy disconnectSession]; self.proxy = nil; [self.fileManager stop]; diff --git a/SmartDeviceLink/SDLProxy.h b/SmartDeviceLink/SDLProxy.h index 60a68f44c..54558625b 100644 --- a/SmartDeviceLink/SDLProxy.h +++ b/SmartDeviceLink/SDLProxy.h @@ -133,6 +133,9 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)putFileStream:(NSInputStream *)inputStream withRequest:(SDLPutFile *)putFileRPCRequest; +/// Disconnects the current app session , including the security manager and primary transport. +- (void)disconnectSession; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m index d7d78fc83..a64e884c2 100644 --- a/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink/SDLProxy.m @@ -174,7 +174,8 @@ + (SDLProxy *)tcpProxyWithListener:(id)delegate tcpIPAddress:( return ret; } -- (void)dealloc { +- (void)disconnectSession { + SDLLogD(@"Disconnecting the proxy; stopping security manager and primary transport."); if (self.protocol.securityManager != nil) { [self.protocol.securityManager stop]; } @@ -186,6 +187,9 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [_urlSession invalidateAndCancel]; +} + +- (void)dealloc { SDLLogV(@"Proxy dealloc"); } From cc1f2b94a90a59bc9b6877cd909eccc4420c1d42 Mon Sep 17 00:00:00 2001 From: Jim-Nexty <35795928+zhouxin627@users.noreply.github.com> Date: Thu, 9 Apr 2020 10:03:25 +0900 Subject: [PATCH 2/2] Update SmartDeviceLink/SDLProxy.h Co-Authored-By: Joel Fischer --- SmartDeviceLink/SDLProxy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SmartDeviceLink/SDLProxy.h b/SmartDeviceLink/SDLProxy.h index 54558625b..4fd20c4af 100644 --- a/SmartDeviceLink/SDLProxy.h +++ b/SmartDeviceLink/SDLProxy.h @@ -133,7 +133,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)putFileStream:(NSInputStream *)inputStream withRequest:(SDLPutFile *)putFileRPCRequest; -/// Disconnects the current app session , including the security manager and primary transport. +/// Disconnects the current app session, including the security manager and primary transport. - (void)disconnectSession; @end