From dc9a0b39b85733f58b028a4c24f2e31978fc5e98 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 24 Jul 2018 09:26:58 +0100 Subject: [PATCH] Take the MessageManagerLock before calling Graphics::drawFittedText() in the OpenGL demo to avoid hitting an assertion --- examples/GUI/OpenGLDemo.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/GUI/OpenGLDemo.h b/examples/GUI/OpenGLDemo.h index dfba6b02f8..1e7f5606b7 100644 --- a/examples/GUI/OpenGLDemo.h +++ b/examples/GUI/OpenGLDemo.h @@ -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); }