mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added a workaround to the host demo app to avoid subtle event-loop problems with certain plugins on OSX.
This commit is contained in:
parent
a5ec538596
commit
db152f618b
1 changed files with 15 additions and 1 deletions
|
|
@ -32,7 +32,8 @@
|
|||
|
||||
|
||||
//==============================================================================
|
||||
class PluginHostApp : public JUCEApplication
|
||||
class PluginHostApp : public JUCEApplication,
|
||||
private AsyncUpdater
|
||||
{
|
||||
public:
|
||||
PluginHostApp() {}
|
||||
|
|
@ -59,6 +60,19 @@ public:
|
|||
|
||||
mainWindow->menuItemsChanged();
|
||||
|
||||
// Important note! We're going to use an async update here so that if we need
|
||||
// to re-open a file and instantiate some plugins, it will happen AFTER this
|
||||
// initialisation method has returned.
|
||||
// On Windows this probably won't make a difference, but on OSX there's a subtle event loop
|
||||
// issue that can happen if a plugin runs one of those irritating modal dialogs while it's
|
||||
// being loaded. If that happens inside this method, the OSX event loop seems to be in some
|
||||
// kind of special "initialisation" mode and things get confused. But if we load the plugin
|
||||
// later when the normal event loop is running, everything's fine.
|
||||
triggerAsyncUpdate();
|
||||
}
|
||||
|
||||
void handleAsyncUpdate() override
|
||||
{
|
||||
File fileToOpen;
|
||||
|
||||
for (int i = 0; i < getCommandLineParameterArray().size(); ++i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue