I’m setting up an app for iPhone, but I have a problem with messages not being propagated through the message pump. In juce_osx_MessageQueue.h, I see the MessageQueue getting instiantiated, messages getting posted to MessageQueue::post, but runLoopCallback never gets called.
We’re sitting on JUCE commit 27047a75f719acb243bde1bf9b741dd03d7b6466 (2015-12-17)
I checked, there are no differences in that code wrt current head.
If I change:
runLoop = CFRunLoopGetCurrent();
runLoop = CFRunLoopGetMain();
everything works as expected. Caveats?
has anyone confirmed this?
Mind you, the project is a native Swift/Objective-C based app, which links statically to a C++ library which uses JUCE. That might be important (or not).
It seems that your app is not setting up the MessageQueue on the main thread/run-loop. Could it be that your native app sets the run loop to something else before it initialises JUCE?
Thanks Fabian, could very well be, since the first time a message is posted is in a worker thread. I’ll try post just a “dummy” message to guarantee it starts on the main thread, see if that helps.
Indeed, by forcing the setup of MessageQueue on the main thread, it works just fine. Sorry for the noise!