diff --git a/renderdoc/common/common.cpp b/renderdoc/common/common.cpp index ddd5ada1e..5a5c02bc6 100644 --- a/renderdoc/common/common.cpp +++ b/renderdoc/common/common.cpp @@ -254,8 +254,10 @@ uint64_t Log2Floor(uint64_t value) static string &logfile() { - static string fn; - return fn; + // deliberately leak this so that it doesn't get destructed while we're still logging in process + // teardown. + static string *fn = new string; + return *fn; } const char *rdclog_getfilename()