Modal loops and plugins


#1

 

Hey Jules -

I'm under the impression that modal loops are to be avoided in plugins (complex interactions with the host windows, and some hosts seem to really not handle modal components well at all).

 

So .... I've been removing all modal items from my code, and finally got around to setting JUCE_MODAL_LOOPS_PERMITTED to 0.

 

The thing is .... the VST wrappers seem to need modal loops?  At least VST3_Wrapper has (at l ine 240):

        MessageManager::getInstance()->runDispatchLoopUntil (1);

 

Which requires modal loops.

 

So .... am I wrong to be avoiding them?  Or is it good to be avoiding them, but I should still have the permission flag set to 1 perhaps?

 

Thanks!

Aaron

 

 

 


#2

Yes, avoid modal loops at all costs!

That line is just an internal hacky workaround - as I've explained a whole bunch of times elsewhere, it's a desperate bodge to avoid a problem in some hosts where they unload the DLL from memory before the OS has released their editor window.


#3

 

Ah, ok great.  Sorry for being repetitive then, I probably could have found this answer with a little digging in the forum.

 

Thanks for the reply though, cheers!