1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Take the MessageManagerLock before calling Graphics::drawFittedText() in the OpenGL demo to avoid hitting an assertion

This commit is contained in:
ed 2018-07-24 09:26:58 +01:00
parent e68fc5e70e
commit dc9a0b39b8

View file

@ -282,6 +282,11 @@ struct OpenGLDemoClasses
g.setColour (Colours::black);
g.setFont (40);
const MessageManagerLock mml (ThreadPoolJob::getCurrentThreadPoolJob());
if (! mml.lockWasGained())
return false;
g.drawFittedText (String (Time::getCurrentTime().getMilliseconds()), image.getBounds(), Justification::centred, 1);
}