Hi, with juce tip,
I had some crashes upon closing of my plugin windows. The crashes happened in the drawing thread while drawing to OpenGL while the main thread is in OpenGLContext::CachedImage::~CachedImage() doing stopThread.
Seems like the context somehow got closed while the drawing thread is drawing to it..
I found that adding calls to CGLLockContext and CGLUnlockContext around drawing solves the problem.
see https://github.com/yairchu/JUCE/commit/ ... b42d307837
not suggesting to actually use this commit it's somewhat hackish with #ifdefs for mac etc