diff options
author | BrettyWhite <geekman3454@protonmail.com> | 2017-06-14 15:35:35 -0400 |
---|---|---|
committer | BrettyWhite <geekman3454@protonmail.com> | 2017-06-14 15:35:35 -0400 |
commit | d8ce0dbcc8d804e5de3b1f88362ef3aa7d001fc8 (patch) | |
tree | 0e75d1347bba600f7917b6622b6067f583338c88 | |
parent | 7335c326b4a2d2c95c462527f5b7dad2409b63c7 (diff) | |
download | sdl_ios-d8ce0dbcc8d804e5de3b1f88362ef3aa7d001fc8.tar.gz |
FIx crash when using example app with iAP
-rw-r--r-- | SmartDeviceLink_Example/Classes/ProxyManager.m | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/SmartDeviceLink_Example/Classes/ProxyManager.m b/SmartDeviceLink_Example/Classes/ProxyManager.m index 891783100..f842d58bd 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){ SDLLifecycleConfiguration *lifecycleConfig = [self.class setLifecycleConfigurationPropertiesOnConfiguration:[SDLLifecycleConfiguration defaultConfigurationWithAppName:SDLAppName appId:SDLAppId]]; // Assume this is production and disable logging @@ -79,15 +81,19 @@ NS_ASSUME_NONNULL_BEGIN self.sdlManager = [[SDLManager alloc] initWithConfiguration:config delegate:self]; [self startManager]; + } } - (void)startTCP { [self sdlex_updateProxyState:ProxyStateSearchingForConnection]; + // Check for previous instance of sdlManager + if (!self.sdlManager){ 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]; [self startManager]; + } } - (void)startManager { @@ -112,6 +118,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)reset { [self sdlex_updateProxyState:ProxyStateStopped]; [self.sdlManager stop]; + // Remove reference + self.sdlManager = nil; } - (void)showInitialData { |