From d5373eed02b2a4ea6916956216fc5eb3e0635c52 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 15 Jul 2021 09:05:18 +0100 Subject: [PATCH] Projucer: Partially revert 8ce68447 When loading exporter icons on a background save thread we need to take the MessageManagerLock as the image file may be an SVG which has a message thread dependency in the Drawable parsing code --- extras/Projucer/Source/Project/jucer_Project.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extras/Projucer/Source/Project/jucer_Project.cpp b/extras/Projucer/Source/Project/jucer_Project.cpp index 47b1e9ac67..8fbd6c455f 100644 --- a/extras/Projucer/Source/Project/jucer_Project.cpp +++ b/extras/Projucer/Source/Project/jucer_Project.cpp @@ -1548,6 +1548,11 @@ void Project::Item::setID (const String& newID) { state.setProperty (Ids::ID, std::unique_ptr Project::Item::loadAsImageFile() const { + const MessageManagerLock mml (ThreadPoolJob::getCurrentThreadPoolJob()); + + if (! mml.lockWasGained()) + return nullptr; + if (isValid()) return Drawable::createFromImageFile (getFile());