From b70df7607c5cfb908bc2c29ad45cba817a33f56b Mon Sep 17 00:00:00 2001 From: Palana Date: Tue, 31 Dec 2013 18:46:19 +0100 Subject: [PATCH] synchronize opengl context access on osx between threads --- libobs-opengl/gl-cocoa.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libobs-opengl/gl-cocoa.m b/libobs-opengl/gl-cocoa.m index 5ccabb04e..143fb2b02 100644 --- a/libobs-opengl/gl-cocoa.m +++ b/libobs-opengl/gl-cocoa.m @@ -227,12 +227,14 @@ void gl_update(device_t device) void device_entercontext(device_t device) { + CGLLockContext([device->plat->context CGLContextObj]); [device->plat->context makeCurrentContext]; } void device_leavecontext(device_t device) { [NSOpenGLContext clearCurrentContext]; + CGLUnlockContext([device->plat->context CGLContextObj]); } void device_load_swapchain(device_t device, swapchain_t swap)