From 05dbd0ab3ef8013085413b3d2e6583fed8ad333f Mon Sep 17 00:00:00 2001 From: Nikos Kastellanos Date: Mon, 5 Jun 2017 16:43:43 +0300 Subject: [PATCH] Bugfix: Calling ApplyChanges() in Game actor cause Exception Reported as #5173 (https://github.com/MonoGame/MonoGame/issues/5173) This is a temp fix. Calling ApplyChanges() should create the graphics Device anytime. --- MonoGame.Framework/GraphicsDeviceManager.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MonoGame.Framework/GraphicsDeviceManager.cs b/MonoGame.Framework/GraphicsDeviceManager.cs index b3f0bfb7221..64cad4116a3 100644 --- a/MonoGame.Framework/GraphicsDeviceManager.cs +++ b/MonoGame.Framework/GraphicsDeviceManager.cs @@ -416,6 +416,11 @@ private void CreateDevice_SDLNew() /// public void ApplyChanges() { +#if WINDOWS_UAP + if (_graphicsDevice == null) + return; +#endif + // If the device hasn't been created then create it now. if (_strategy.GraphicsDevice == null) CreateDevice();