From 13f99df268c7d069f5dba881eb1c33ac66e41ed4 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 9 Jul 2014 18:16:48 +0100 Subject: [PATCH] Fix for changing the OSX HighResolutionTimer interval while it's still running. --- modules/juce_core/native/juce_posix_SharedCode.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index 5e0ba4500b..7bdbc55baf 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -1150,10 +1150,11 @@ struct HighResolutionTimer::Pimpl void start (int newPeriod) { - periodMs = newPeriod; - - if (thread == 0) + if (periodMs != newPeriod) { + stop(); + periodMs = newPeriod; + shouldStop = false; if (pthread_create (&thread, nullptr, timerThread, this) == 0)