summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2020-04-02 15:21:23 -0400
committerNicoleYarroch <nicole@livio.io>2020-04-02 15:21:23 -0400
commit4d703f0e98fa4aacc714728be328cba50eaefe10 (patch)
tree23fd4a8fe8cf59c3ee1d4f48fa8be2eb840122d8
parent1e0cb91b3805e92c6fff56f5aabd37a648318d08 (diff)
downloadsdl_ios-bugfix/issue_1584_choice_set_manager_not_thread_safe.tar.gz
-rw-r--r--SmartDeviceLink/SDLTextAndGraphicManager.m15
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