From d6039e87abfa8a055c2b940be3bcb0615df41649 Mon Sep 17 00:00:00 2001 From: dexy Date: Fri, 7 Jan 2022 21:19:48 +1100 Subject: [PATCH] Fix for crash when closing DX window when CW not active --- CodeWalker/Rendering/DirectX/DXManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/CodeWalker/Rendering/DirectX/DXManager.cs b/CodeWalker/Rendering/DirectX/DXManager.cs index 534083f..0a0e5ee 100644 --- a/CodeWalker/Rendering/DirectX/DXManager.cs +++ b/CodeWalker/Rendering/DirectX/DXManager.cs @@ -284,6 +284,7 @@ namespace CodeWalker.Rendering if (Form.ActiveForm == null) { Thread.Sleep(100); //reduce the FPS when the app isn't active (maybe this should be configurable?) + if (context.IsDisposed) return; //if form closed while sleeping (eg from rightclick on taskbar) } Rendering = true;