From 3dc09c38d30c04ccf08bd8b28c7b05919d0a9d53 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 31 Jul 2021 09:56:52 +0200 Subject: [PATCH] dxgsg9: Fix crash when resizing window in multi-window setup Fixes #1167 --- panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index bd36f99da3..0138463260 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -4767,6 +4767,9 @@ release_swap_chain(DXScreenData *new_context) { wdxdisplay9_cat.debug() << "Swapchain release failed:" << D3DERRORSTRING(hr) << "\n"; return false; } + if (new_context->_swap_chain == _swap_chain) { + _swap_chain = nullptr; + } } return true; }