From 434534d2e35c30a225c584b72c984cb437a21a2e Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 24 Jul 2017 14:17:25 +0100 Subject: [PATCH] Release DIA2 handles when shutting down callstack resolver * Otherwise a handle is kept open to the PDB and you can't recompile. --- renderdoc/os/win32/win32_callstack.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/renderdoc/os/win32/win32_callstack.cpp b/renderdoc/os/win32/win32_callstack.cpp index 25548923d..5f1df6596 100644 --- a/renderdoc/os/win32/win32_callstack.cpp +++ b/renderdoc/os/win32/win32_callstack.cpp @@ -180,6 +180,15 @@ uint32_t GetModule(const wchar_t *pdbName, GUID guid, DWORD age) return 0; } +void Release(uint32_t module) +{ + if(module > 0 && module <= modules.size()) + { + SAFE_RELEASE(modules[module - 1].pSession); + SAFE_RELEASE(modules[module - 1].pSource); + } +} + void SetBaseAddress(uint32_t module, uint64_t addr) { if(module > 0 && module <= modules.size()) @@ -868,6 +877,8 @@ Win32CallstackResolver::Win32CallstackResolver(char *moduleDB, size_t DBSize, st Win32CallstackResolver::~Win32CallstackResolver() { + for(size_t i = 0; i < modules.size(); i++) + DIA2::Release(modules[i].moduleId); } Callstack::AddressDetails Win32CallstackResolver::GetAddr(DWORD64 addr)