Drawing in setStateInformation

For AUv3, I found I needed to call something like the variant below when setStateInformation is called on a background worker thread (in Logic) different from the createEditor thread. Otherwise an assertion is triggered in CoreAutoLayout under setBounds (_AssertAutoLayoutOnAllowedThreadsOnly):

diff --git a/General/foleys_MagicProcessor.cpp b/General/foleys_MagicProcessor.cpp
index 03715e8..63c92ed 100644
--- a/General/foleys_MagicProcessor.cpp
+++ b/General/foleys_MagicProcessor.cpp
@@ -113,4 +113,12 @@ void MagicProcessor::setStateInformation (const void* data, int sizeInBytes)
+void MagicProcessor::setStateInformationNoDrawing (const void* data, int sizeInBytes)
+    magicState.setStateInformation (data, sizeInBytes, nullptr);
+    postSetStateInformation();
 } // namespace foleys
diff --git a/General/foleys_MagicProcessor.h b/General/foleys_MagicProcessor.h
index 6a82778..2a52ca5 100644
--- a/General/foleys_MagicProcessor.h
+++ b/General/foleys_MagicProcessor.h
@@ -108,6 +108,7 @@ public:
     void getStateInformation (juce::MemoryBlock& destData) override;
     void setStateInformation (const void* data, int sizeInBytes) override;
+    void setStateInformationNoDrawing (const void* data, int sizeInBytes);

Thank you for the heads up.
I will move the editor->setSize (width, height); call into a MessageManager::callAsync().
That should avert the issue.

EDIT: here it is