From a442bb50b4266931db370937a2d36b5dcce07c35 Mon Sep 17 00:00:00 2001 From: sephiroth99 Date: Thu, 11 Feb 2016 23:50:11 -0500 Subject: [PATCH] Prevent undefined behaviour with thread_safe_gl enabled. CreateOffscreenContext already calls ClearCurrent. When it is done twice, the global GL mutex is unlocked a second time, and undefined behavour happens. In this particular case, a deadlock occured; unlocking the already unlocked mutex locked it. --- src/xenia/gpu/graphics_system.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/xenia/gpu/graphics_system.cc b/src/xenia/gpu/graphics_system.cc index fe5602f94..5eadcd0bc 100644 --- a/src/xenia/gpu/graphics_system.cc +++ b/src/xenia/gpu/graphics_system.cc @@ -59,7 +59,6 @@ X_STATUS GraphicsSystem::Setup(cpu::Processor* processor, // It's shared with the display context so that we can resolve framebuffers // from it. processor_context = provider()->CreateOffscreenContext(); - processor_context->ClearCurrent(); }); if (!processor_context) { xe::FatalError(