Skip to content

Commit

Permalink
D3D12: Fix crash that could occur on res resize
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Mar 8, 2024
1 parent 2d92662 commit 0672795
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,14 @@ bool Framework::init_d3d12() {
}

void Framework::deinit_d3d12() {
for (auto& ctx : m_d3d12.cmd_ctxs) {
if (ctx != nullptr) {
ctx->reset();
}
}

m_d3d12.cmd_ctxs.clear();

for (auto userdata : m_d3d12.imgui_backend_datas) {
if (userdata != nullptr) {
ImGui::GetIO().BackendRendererUserData = userdata;
Expand Down

0 comments on commit 0672795

Please sign in to comment.