From 4fbd66c201a032e086169f50eb032d2834f9d8a3 Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Mon, 15 Apr 2019 15:54:36 -0400 Subject: Fix resetting SDL --- Example Apps/Example ObjC/ProxyManager.m | 9 +-------- Example Apps/Example Swift/ProxyManager.swift | 6 +----- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Example Apps/Example ObjC/ProxyManager.m b/Example Apps/Example ObjC/ProxyManager.m index a510c79ee..03ebd5151 100644 --- a/Example Apps/Example ObjC/ProxyManager.m +++ b/Example Apps/Example ObjC/ProxyManager.m @@ -76,12 +76,8 @@ NS_ASSUME_NONNULL_BEGIN } - (void)reset { - if (self.sdlManager == nil) { - [self sdlex_updateProxyState:ProxyStateStopped]; - return; - } - [self.sdlManager stop]; + [self sdlex_updateProxyState:ProxyStateStopped]; } - (void)sdlex_updateProxyState:(ProxyState)newState { @@ -97,9 +93,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)startWithProxyTransportType:(ProxyTransportType)proxyTransportType { [self sdlex_updateProxyState:ProxyStateSearchingForConnection]; - // Check for previous instance of sdlManager - if (self.sdlManager) { return; } - SDLLifecycleConfiguration *lifecycleConfig = proxyTransportType == ProxyTransportTypeIAP ? [self.class sdlex_iapLifecycleConfiguration] : [self.class sdlex_tcpLifecycleConfiguration]; [self sdlex_setupConfigurationWithLifecycleConfiguration:lifecycleConfig]; } diff --git a/Example Apps/Example Swift/ProxyManager.swift b/Example Apps/Example Swift/ProxyManager.swift index 3b0ca25a4..85f33bf53 100644 --- a/Example Apps/Example Swift/ProxyManager.swift +++ b/Example Apps/Example Swift/ProxyManager.swift @@ -50,12 +50,8 @@ extension ProxyManager { /// Attempts to close the connection between the this app and the car's head unit. The `SDLManagerDelegate`'s `managerDidDisconnect()` is called when connection is actually closed. func resetConnection() { - guard sdlManager != nil else { - delegate?.didChangeProxyState(ProxyState.stopped) - return - } - sdlManager.stop() + delegate?.didChangeProxyState(ProxyState.stopped) } } -- cgit v1.2.1