Fix OpenGL Context freeing

This commit is contained in:
Campbell Barton 2015-01-12 22:02:06 +11:00
parent 324d0448b1
commit 0073b17d03
1 changed files with 2 additions and 1 deletions

View File

@ -75,9 +75,10 @@ GHOST_ContextCGL::GHOST_ContextCGL(
GHOST_ContextCGL::~GHOST_ContextCGL()
{
if (m_openGLContext != nil) {
if (m_openGLContext == [NSOpenGLContext currentContext])
if (m_openGLContext == [NSOpenGLContext currentContext]) {
[NSOpenGLContext clearCurrentContext];
[m_openGLView clearGLContext];
}
if (m_openGLContext != s_sharedOpenGLContext || s_sharedCount == 1) {
assert(s_sharedCount > 0);