diff options
author | Muller, Alexander (A.) <amulle19@ford.com> | 2017-01-26 11:34:23 -0800 |
---|---|---|
committer | Muller, Alexander (A.) <amulle19@ford.com> | 2017-01-26 11:34:23 -0800 |
commit | b7ee68bfebc6ce528195883d2fd94820cd32ee62 (patch) | |
tree | 5cca3f70502b8ffb24edd66ddabdb0c153bbeb05 | |
parent | 9f1f06918edcba0fcd10559f426a2029c5664a65 (diff) | |
download | sdl_ios-hotfix/issue_509_stop_proxy.tar.gz |
Fixed issue with retain cycle within the dispatch_after block.hotfix/issue_509_stop_proxy
-rw-r--r-- | SmartDeviceLink/SDLLifecycleManager.m | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m index 4fdab412f..e322452f3 100644 --- a/SmartDeviceLink/SDLLifecycleManager.m +++ b/SmartDeviceLink/SDLLifecycleManager.m @@ -186,11 +186,12 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; // Due to a race condition internally with EAStream, we cannot immediately attempt to restart the proxy, as we will randomly crash. // Apple Bug ID #30059457 + __weak typeof(self) weakSelf = self; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self.delegate managerDidDisconnect]; + [weakSelf.delegate managerDidDisconnect]; if (shouldRestart) { - [self.lifecycleStateMachine transitionToState:SDLLifecycleStateStarted]; + [weakSelf.lifecycleStateMachine transitionToState:SDLLifecycleStateStarted]; } }); } |