From 5ae32084a770e81d42ad4031fd9158fe50a7cf3a Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 13 Nov 2020 16:12:27 +0000 Subject: [PATCH] Made the assertion in the Timer destructor slightly less strict --- modules/juce_events/timers/juce_Timer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/juce_events/timers/juce_Timer.cpp b/modules/juce_events/timers/juce_Timer.cpp index 462b1420ab..e1c3459e03 100644 --- a/modules/juce_events/timers/juce_Timer.cpp +++ b/modules/juce_events/timers/juce_Timer.cpp @@ -321,7 +321,9 @@ Timer::~Timer() // been stopped before execution reaches this point. A simple way to achieve this // is to add a call to `stopTimer()` to the destructor of your class which inherits // from Timer. - jassert (MessageManager::existsAndIsCurrentThread() || ! isTimerRunning()); + jassert (! isTimerRunning() + || MessageManager::getInstanceWithoutCreating() == nullptr + || MessageManager::getInstanceWithoutCreating()->currentThreadHasLockedMessageManager()); stopTimer(); }