I finished debuging the problem with Cubase disapearing after rejecting my plug. What happens with Cubase is this:
main() called, audio master version 2200
dispatcher<-effIdentify returned CCONST:1316373862
I am yet to find why effIdentify() failed and what its supposed to do anyway…
After this Cubase disapeared and in the debugger it seems that the problem is that a thread was stopped by force:
Logger::writeToLog (T("!! killing thread by force !!"));
It was a timer thread belonging to a texteditor of a combobox!
One problem was that my editor didn’t call DeleteAllChildren() in the destructor but that did not solve the problem.
the problems with JuceVstWrapper (that I fixed now) are:
The DLL was unloaded without calling effOpen or effClose so the wrapper was not deleted. I added DeletedAtShutdown as a base class to the wrapper so it will be deleted when the DLL unload
createEditorComp() was called twice, both in not the best place maybe. One in the constructor which is too early since effOpen was not received yet and like in the Cubase example there is no reason to create it if the plugin is not even opened. The second place is effEditOpen which is too late since my filter interacts with the editor when processBlock is called. so I moved createEditorComp() to the open() method and problem was finally solved.
Next task is fix the effIdentify problem and see that all is ok with Cubase. Next is to make FLStudio detect my Vst as an instrument and not an effect. Then Live, Podium, Sonar, Orion, Project 5…
Good night 8)