I have a thread that needs to do some gui stuff and then ends. The run method looks something like this:
void MyDialog::run()
{
MessageManagerLock mmlock;
label1->setText("some text", dontSendNotification);
}
I get an assertion here:
void Font::getGlyphPositions (const String& text, Array<int>& glyphs, Array<float>& xOffsets) const
{
// This call isn't thread-safe when there's a message thread running
jassert (MessageManager::getInstanceWithoutCreating() == nullptr
|| MessageManager::getInstanceWithoutCreating()->currentThreadHasLockedMessageManager());
Debugging this, it seems that getInstanceWithoutCreating is returning a non zero value and that the currentThreadHasLockedMessageManager is false.
Am I doing something wrong? Why isn’t the Message thread locked?