diff --git a/renderdoc/os/win32/win32_callstack.cpp b/renderdoc/os/win32/win32_callstack.cpp index cafafe47c..28702f6cd 100644 --- a/renderdoc/os/win32/win32_callstack.cpp +++ b/renderdoc/os/win32/win32_callstack.cpp @@ -1076,7 +1076,10 @@ namespace Callstack { void Init() { - ::InitDbgHelp(); + // if we're capturing, need to initialise immediately to claim ownership and be ready to collect + // callstacks. On replay we can do this later when needed. + if(!RenderDoc::Inst().IsReplayApp()) + ::InitDbgHelp(); } Stackwalk *Collect() @@ -1097,6 +1100,9 @@ StackResolver *MakeResolver(byte *moduleDB, size_t DBSize, RENDERDOC_ProgressCal return NULL; } + // initialise dbghelp if we haven't already + ::InitDbgHelp(); + return new Win32CallstackResolver(moduleDB, DBSize, progress); }