mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-01 03:10:06 +00:00
Unity: Initialise JUCE GUI earlier to avoid hitting some assertions
This commit is contained in:
parent
aaad33ce57
commit
4e54953f01
1 changed files with 5 additions and 6 deletions
|
|
@ -505,9 +505,6 @@ namespace UnityCallbacks
|
|||
{
|
||||
int UNITY_INTERFACE_API createCallback (UnityAudioEffectState* state)
|
||||
{
|
||||
if (getWrapperMap().size() == 0)
|
||||
initialiseJuce_GUI();
|
||||
|
||||
auto* pluginInstance = new AudioProcessorUnityWrapper (false);
|
||||
pluginInstance->create (state);
|
||||
|
||||
|
|
@ -671,14 +668,16 @@ static void declareEffect (UnityAudioEffectDefinition& definition)
|
|||
|
||||
UNITY_INTERFACE_EXPORT int UnityGetAudioEffectDefinitions (UnityAudioEffectDefinition*** definitionsPtr)
|
||||
{
|
||||
static bool hasSetWrapperType = false;
|
||||
static bool hasInitialised = false;
|
||||
|
||||
if (! hasSetWrapperType)
|
||||
if (! hasInitialised)
|
||||
{
|
||||
juce::initialiseJuce_GUI();
|
||||
|
||||
juce::PluginHostType::jucePlugInClientCurrentWrapperType = juce::AudioProcessor::wrapperType_Unity;
|
||||
juce::juce_createUnityPeerFn = juce::createUnityPeer;
|
||||
|
||||
hasSetWrapperType = true;
|
||||
hasInitialised = true;
|
||||
}
|
||||
|
||||
auto* definition = new UnityAudioEffectDefinition();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue