From c316c059ef2ffff40544530dd649c3fa9ef83ec4 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Thu, 20 May 2021 14:29:10 +0100 Subject: [PATCH] Assign _backgroundContext before starting its worker thread. (#2299) Fixes a random crash when starting an embedded game. --- Ryujinx.Graphics.OpenGL/BackgroundContextWorker.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ryujinx.Graphics.OpenGL/BackgroundContextWorker.cs b/Ryujinx.Graphics.OpenGL/BackgroundContextWorker.cs index f942037c2..3f1c055bf 100644 --- a/Ryujinx.Graphics.OpenGL/BackgroundContextWorker.cs +++ b/Ryujinx.Graphics.OpenGL/BackgroundContextWorker.cs @@ -19,6 +19,7 @@ namespace Ryujinx.Graphics.OpenGL public BackgroundContextWorker(IOpenGLContext backgroundContext) { + _backgroundContext = backgroundContext; _running = true; _signal = new AutoResetEvent(false); @@ -27,7 +28,6 @@ namespace Ryujinx.Graphics.OpenGL _thread = new Thread(Run); _thread.Start(); - _backgroundContext = backgroundContext; } private void Run()