OpenGLContext assert on OSX when closing VST editor


#1

Hi,

OpenGLContext crashes most of the times when closing plugin editor. This happens at least on VST2, and if I recall correctly, on VST3 as well. I hit this with both latest Cubase 9, and the latest Juce Plugin Demo Host.

Closing VST UI: Juce501Plugin
***** GL_INVALID_FRAMEBUFFER_OPERATION at …/…/…/JUCE/modules/juce_opengl/opengl/juce_OpenGLContext.cpp : 1176
JUCE Assertion failure in juce_opengl.cpp:155

Running latest tip, I was able to reproduce this by creating an empty plugin project with Projucer, and adding the OpenGL context as explained here:

Plugin Editor class declaration:
OpenGLContext context;

Constructor:
context.attachTo (*this);
context.setContinuousRepainting (true);

Destructor:
context.detach();

Running on OSX 10.10.5.
Was this issue already resolved earlier?
I couldn’t find any fix for it yet.

Thanks,
Olli


#2

Hi @ollierikkeskinen ,

See the fix for this in the following commit on develop:

I’ve tested this in a variety of DAWs (Cubase, WaveLab, REAPER, BitWig,…) and everything seems to be working nicely…

…then I tried Studio One and it still crashes when the editor is destroyed (arrgghhh). I’m still investigating on what exactly is invalidating the GL context. The window is still open and visible and the opengl view and all of it’s parents are still there when the context is invalidated. I just don’t understand how I can get a callback just before the gl context is invalidated. I even tried this in a plug-in that doesn’t use JUCE at all (just a NSOpenGLView) and I still get a crash in Studio One.

Any ideas?


#3

Hi Fabian,

Thank you for the quick fix, it solved the problem for me. :slight_smile:
I don’t have access to Studio One, so haven’t tried that, but thanks for letting us know that it might still cause trouble.

Thanks!
Olli


#4

I believe that the original fix which I suggested for this issue resolves the problem on all hosts including Studio One.


#5

Thanks @yairadix. This is now fixed on the develop branch.