From 19513f5725a64c409f6a56f784649d99a2a045c8 Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 20 Dec 2018 17:13:17 +0000 Subject: [PATCH] Added a re-entrancy check to the plugin scanner, so that if plugins pump the message thread it'll avoid triggering nested scans --- .../scanning/juce_PluginListComponent.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp b/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp index a2ff14f7da..6d4602b1da 100644 --- a/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp +++ b/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp @@ -399,7 +399,7 @@ private: String pluginBeingScanned; double progress; int numThreads; - bool allowAsync, finished; + bool allowAsync, finished, timerReentrancyCheck = false; std::unique_ptr pool; static void startScanCallback (int result, AlertWindow* alert, Scanner* scanner) @@ -518,6 +518,11 @@ private: void timerCallback() override { + if (timerReentrancyCheck) + return; + + const ScopedValueSetter setter (timerReentrancyCheck, true); + if (pool == nullptr) { if (doNextScan())