summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2019-05-21 15:53:07 -0400
committerNicoleYarroch <nicole@livio.io>2019-05-21 15:53:07 -0400
commit0dd2255e40c9dd079db09f3a94d1c74df924cbe9 (patch)
treee2135d02c5d2e982d50f885372121cb7e1c46b0c
parent96f81e5b4f3f99364b5de7ce8fc58fe70aee66c8 (diff)
downloadsdl_ios-0dd2255e40c9dd079db09f3a94d1c74df924cbe9.tar.gz
Fixed example app crashing when lifecycle manager errors
-rw-r--r--Example Apps/Example ObjC/ProxyManager.m5
-rw-r--r--Example Apps/Example Swift/ProxyManager.swift5
2 files changed, 8 insertions, 2 deletions
diff --git a/Example Apps/Example ObjC/ProxyManager.m b/Example Apps/Example ObjC/ProxyManager.m
index 525f31766..a7732892a 100644
--- a/Example Apps/Example ObjC/ProxyManager.m
+++ b/Example Apps/Example ObjC/ProxyManager.m
@@ -76,7 +76,10 @@ NS_ASSUME_NONNULL_BEGIN
}
- (void)stopConnection {
- [self.sdlManager stop];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self.sdlManager stop];
+ });
+
[self sdlex_updateProxyState:ProxyStateStopped];
}
diff --git a/Example Apps/Example Swift/ProxyManager.swift b/Example Apps/Example Swift/ProxyManager.swift
index fbedae0d5..b6287bf6e 100644
--- a/Example Apps/Example Swift/ProxyManager.swift
+++ b/Example Apps/Example Swift/ProxyManager.swift
@@ -55,7 +55,10 @@ extension ProxyManager {
return
}
- sdlManager.stop()
+ DispatchQueue.main.async { [weak self] in
+ self?.sdlManager.stop()
+ }
+
delegate?.didChangeProxyState(.stopped)
}
}