Crashes with new OpenGL classes

Discussion and support for general JUCE issues

Crashes with new OpenGL classes

Postby yairadix » Tue Apr 03, 2012 5:35 pm

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

cheers, Yair
Last edited by yairadix on Tue Apr 03, 2012 11:49 pm, edited 1 time in total.
User avatar
yairadix
JUCE UberWeenie
 
Posts: 130
Joined: Fri Jul 23, 2010 10:38 pm

Re: Crashes with new OpneGL classes

Postby jules » Tue Apr 03, 2012 5:54 pm

Ok... Interesting. I didn't know about the CGL lock functions, I'll have a read about them, thanks!
User avatar
jules
Fearless Leader
 
Posts: 17189
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Crashes with new OpneGL classes

Postby yairadix » Tue Apr 03, 2012 11:15 pm

Thx for the quick fix, awesome responsiveness :)
Just one thing - with 10.5 SDK (which is used for ppc targets) these functions require adding an additional include:

Code: Select all
#include <OpenGL/OpenGL.h>


I suppose that with later SDKs that include gets there via other includes anyhow or something.
User avatar
yairadix
JUCE UberWeenie
 
Posts: 130
Joined: Fri Jul 23, 2010 10:38 pm

Re: Crashes with new OpenGL classes

Postby jules » Wed Apr 04, 2012 8:59 am

Ah, that dratted 10.5 SDK. Thanks!
User avatar
jules
Fearless Leader
 
Posts: 17189
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK


Return to General JUCE discussion

Who is online

Users browsing this forum: Google Feedfetcher and 3 guests