diff options
author | NicoleYarroch <nicole@livio.io> | 2020-04-02 15:21:23 -0400 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2020-04-02 15:21:23 -0400 |
commit | 4d703f0e98fa4aacc714728be328cba50eaefe10 (patch) | |
tree | 23fd4a8fe8cf59c3ee1d4f48fa8be2eb840122d8 | |
parent | 1e0cb91b3805e92c6fff56f5aabd37a648318d08 (diff) | |
download | sdl_ios-bugfix/issue_1584_choice_set_manager_not_thread_safe.tar.gz |
Reset on startbugfix/issue_1584_choice_set_manager_not_thread_safe
-rw-r--r-- | SmartDeviceLink/SDLTextAndGraphicManager.m | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLTextAndGraphicManager.m b/SmartDeviceLink/SDLTextAndGraphicManager.m index 0685d6fd6..7da2808e3 100644 --- a/SmartDeviceLink/SDLTextAndGraphicManager.m +++ b/SmartDeviceLink/SDLTextAndGraphicManager.m @@ -87,10 +87,23 @@ NS_ASSUME_NONNULL_BEGIN } - (void)start { + SDLLogD(@"Starting manager"); + + // Make sure none of the properties were set after the manager was shut down + [self sdl_reset]; + [self.systemCapabilityManager subscribeToCapabilityType:SDLSystemCapabilityTypeDisplays withObserver:self selector:@selector(sdl_displayCapabilityDidUpdate:)]; } - (void)stop { + SDLLogD(@"Stopping manager"); + [self sdl_reset]; + + [self.systemCapabilityManager unsubscribeFromCapabilityType:SDLSystemCapabilityTypeDisplays withObserver:self]; +} + +- (void)sdl_reset { + SDLLogV(@"Resetting properties"); _textField1 = nil; _textField2 = nil; _textField3 = nil; @@ -115,8 +128,6 @@ NS_ASSUME_NONNULL_BEGIN _blankArtwork = nil; _waitingOnHMILevelUpdateToUpdate = NO; _isDirty = NO; - - [self.systemCapabilityManager unsubscribeFromCapabilityType:SDLSystemCapabilityTypeDisplays withObserver:self]; } #pragma mark - Upload / Send |