summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2020-11-06 14:44:22 -0500
committerGitHub <noreply@github.com>2020-11-06 14:44:22 -0500
commit983819a3e0c30cb96f6a63ed1df2a2c515cacf96 (patch)
tree2d77ad1908b9cd5aa4e79a35f4744f48208ce049
parentfbcf9d2be5599138b8b3ee4ef968791b54ab34f8 (diff)
parentc23566bce3c3e3feaa1f96cf93f6bc9806c6b4cc (diff)
downloadsdl_ios-983819a3e0c30cb96f6a63ed1df2a2c515cacf96.tar.gz
Merge pull request #1805 from smartdevicelink/bugfix/issue-1798-setting-SDLTouchManager.tapTimeThresgold-to-0.0-causes-debug-crash
Fixed TouchManager TapTimeThreshold at 0.0 causes debug crash
-rw-r--r--SmartDeviceLink/public/SDLTouchManager.m16
1 files changed, 10 insertions, 6 deletions
diff --git a/SmartDeviceLink/public/SDLTouchManager.m b/SmartDeviceLink/public/SDLTouchManager.m
index ad9eb4703..25b88d6fa 100644
--- a/SmartDeviceLink/public/SDLTouchManager.m
+++ b/SmartDeviceLink/public/SDLTouchManager.m
@@ -434,12 +434,16 @@ static NSUInteger const MaximumNumberOfTouches = 2;
[self sdl_cancelSingleTapTimer];
}
- __weak typeof(self) weakSelf = self;
- self.singleTapTimer = [[SDLTimer alloc] initWithDuration:self.tapTimeThreshold];
- self.singleTapTimer.elapsedBlock = ^{
- [weakSelf sdl_singleTapTimerCallbackWithPoint:point];
- };
- [self.singleTapTimer start];
+ if (self.tapTimeThreshold == 0.0) {
+ [self sdl_singleTapTimerCallbackWithPoint:point];
+ } else {
+ __weak typeof(self) weakSelf = self;
+ self.singleTapTimer = [[SDLTimer alloc] initWithDuration:self.tapTimeThreshold];
+ self.singleTapTimer.elapsedBlock = ^{
+ [weakSelf sdl_singleTapTimerCallbackWithPoint:point];
+ };
+ [self.singleTapTimer start];
+ }
}
/**