diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-06-26 13:10:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-26 13:10:49 -0400 |
commit | e005a34c0f1126e5038b241ccca79fff3f896f53 (patch) | |
tree | b238d0d2509f75ec78897fec044b2c81ecff4ab4 | |
parent | 0c510685691c2b16479be687d918bab7470f3c97 (diff) | |
parent | d3e6119fc7e7670d6ffa3cd38162906c1d03a605 (diff) | |
download | sdl_ios-e005a34c0f1126e5038b241ccca79fff3f896f53.tar.gz |
Merge pull request #631 from smartdevicelink/bugfix/issue_625
Fix: crash when using example app with iAP
-rw-r--r-- | SmartDeviceLink_Example/Classes/ProxyManager.m | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/SmartDeviceLink_Example/Classes/ProxyManager.m b/SmartDeviceLink_Example/Classes/ProxyManager.m index 891783100..7b08c4f2d 100644 --- a/SmartDeviceLink_Example/Classes/ProxyManager.m +++ b/SmartDeviceLink_Example/Classes/ProxyManager.m @@ -70,6 +70,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)startIAP { [self sdlex_updateProxyState:ProxyStateSearchingForConnection]; + // Check for previous instance of sdlManager + if (self.sdlManager) { return; } SDLLifecycleConfiguration *lifecycleConfig = [self.class setLifecycleConfigurationPropertiesOnConfiguration:[SDLLifecycleConfiguration defaultConfigurationWithAppName:SDLAppName appId:SDLAppId]]; // Assume this is production and disable logging @@ -83,6 +85,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)startTCP { [self sdlex_updateProxyState:ProxyStateSearchingForConnection]; + // Check for previous instance of sdlManager + if (self.sdlManager) { return; } SDLLifecycleConfiguration *lifecycleConfig = [self.class setLifecycleConfigurationPropertiesOnConfiguration:[SDLLifecycleConfiguration debugConfigurationWithAppName:SDLAppName appId:SDLAppId ipAddress:[Preferences sharedPreferences].ipAddress port:[Preferences sharedPreferences].port]]; SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfig lockScreen:[SDLLockScreenConfiguration enabledConfiguration]]; self.sdlManager = [[SDLManager alloc] initWithConfiguration:config delegate:self]; @@ -112,6 +116,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)reset { [self sdlex_updateProxyState:ProxyStateStopped]; [self.sdlManager stop]; + // Remove reference + self.sdlManager = nil; } - (void)showInitialData { |