From 97f62571ffee0f80f331161abb5b2b6ab3bde02a Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Wed, 16 Sep 2015 23:18:30 +0200 Subject: [PATCH] d3d12: Properly clean protected page in dtor --- rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp b/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp index 220efd2462..a9e01a53c2 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp @@ -326,6 +326,15 @@ D3D12GSRender::~D3D12GSRender() { getNonCurrentResourceStorage().WaitAndClean(); + { + std::lock_guard lock(mut); + for (auto &protectedTexture : m_protectedTextures) + { + u32 protectedRangeStart = std::get<1>(protectedTexture), protectedRangeSize = std::get<2>(protectedTexture); + vm::page_protect(protectedRangeStart, protectedRangeSize, 0, vm::page_writable, 0); + } + } + gfxHandler = [this](u32) { return false; }; m_constantsData.Release(); m_vertexIndexData.Release();