summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrettyWhite <geekman3454@protonmail.com>2017-06-14 15:35:35 -0400
committerBrettyWhite <geekman3454@protonmail.com>2017-06-14 15:35:35 -0400
commitd8ce0dbcc8d804e5de3b1f88362ef3aa7d001fc8 (patch)
tree0e75d1347bba600f7917b6622b6067f583338c88
parent7335c326b4a2d2c95c462527f5b7dad2409b63c7 (diff)
downloadsdl_ios-d8ce0dbcc8d804e5de3b1f88362ef3aa7d001fc8.tar.gz
FIx crash when using example app with iAP
-rw-r--r--SmartDeviceLink_Example/Classes/ProxyManager.m8
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 {