Browse Source

dxgsg9: Fix crash when resizing window in multi-window setup

Fixes #1167
rdb 4 years ago
parent
commit
3dc09c38d3
1 changed files with 3 additions and 0 deletions
  1. 3 0
      panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx

+ 3 - 0
panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx

@@ -4767,6 +4767,9 @@ release_swap_chain(DXScreenData *new_context) {
       wdxdisplay9_cat.debug() << "Swapchain release failed:" << D3DERRORSTRING(hr) << "\n";
       wdxdisplay9_cat.debug() << "Swapchain release failed:" << D3DERRORSTRING(hr) << "\n";
       return false;
       return false;
     }
     }
+    if (new_context->_swap_chain == _swap_chain) {
+      _swap_chain = nullptr;
+    }
   }
   }
   return true;
   return true;
 }
 }