Bug in VSTWrapper code if not using editor

I ran across a problem in Ableton Live when using a little VST plugin that I made that has no custom editor.

In fact, when there’s no custom editor, the line:

in the VSTWrapper doesn’t make sense at all. It should set this flag depending on if an editor will be made or not. But to know that in advance would require the filter’s createEditor() to be called.

Yes… Ok, I’ll see if I can find a bodge for that…

I’ve stumbled across the same problem and did this:

AudioProcessorEditor* dummy=filter->createEditor();
if (dummy)
	cEffect.flags |= effFlagsHasEditor;
	delete dummy;
else cEffect.flags =0;

Works fine…

well, it might work for your plugin, but I can’t really use it as a more general fix - the problem is that creating a UI component before the plugin itself has finished being created is just bound to crash a lot of code. It’s a tricky problem to work around without adding an extra explicit flag to say whether there’s a UI…