Load Drawable in a thread

Hi,

I hit an assert trying to load a drawable in a thread

In the code, it does

 auto dp = new DrawablePath();

 setCommonAttributes (*dp, xml);

 dp->setFill (Colours::transparentBlack); 

Where

void DrawableShape::setFill (const FillType& newFill)
{
    if (mainFill != newFill)
    {
        mainFill = newFill;
        repaint();
    }
}

Where repaint does JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED

This isn’t possible ?

Thanks !

You can use JUCE: juce::MessageManagerLock Class Reference to lock the message thread. Create one just before you call setFill().

The thing is I don’t do it myself, it’s in juce_SVGParser.cpp

So I’m just loading a drawable/SVG in a thread, not modifying it afterwards