diff --git a/renderdoc/common/common.cpp b/renderdoc/common/common.cpp index 644bdb181..9b46a4087 100644 --- a/renderdoc/common/common.cpp +++ b/renderdoc/common/common.cpp @@ -256,12 +256,6 @@ void rdclog_filename(const char *filename) logfile() = filename; } -void rdclog_delete() -{ - if(!logfile().empty()) - FileIO::Delete(logfile().c_str()); -} - void rdclog_flush() { } diff --git a/renderdoc/common/common.h b/renderdoc/common/common.h index a2a1ab782..b312426e1 100644 --- a/renderdoc/common/common.h +++ b/renderdoc/common/common.h @@ -140,11 +140,9 @@ void rdclog_int(LogType type, const char *file, unsigned int line, const char *f const char *rdclog_getfilename(); void rdclog_filename(const char *filename); -void rdclog_delete(); #define RDCLOGFILE(fn) rdclog_filename(fn) #define RDCGETLOGFILE() rdclog_getfilename() -#define RDCLOGDELETE() rdclog_delete() #if ( !defined(RELEASE) || defined(FORCE_DEBUG_LOGS) ) && !defined(STRIP_DEBUG_LOGS) #define RDCDEBUG(...) rdclog(RDCLog_Debug, __VA_ARGS__) diff --git a/renderdoc/core/core.cpp b/renderdoc/core/core.cpp index 9ea8aa5f9..d63394e26 100644 --- a/renderdoc/core/core.cpp +++ b/renderdoc/core/core.cpp @@ -203,20 +203,20 @@ void RenderDoc::Initialise() // set default capture log - useful for when hooks aren't setup // through the UI (and a log file isn't set manually) { - string capture_filename, logging_filename; + string capture_filename; const char *base = "RenderDoc_app"; if(IsReplayApp()) base = "RenderDoc_replay"; - FileIO::GetDefaultFiles(base, capture_filename, logging_filename, m_Target); + FileIO::GetDefaultFiles(base, capture_filename, m_LoggingFilename, m_Target); if(m_LogFile.empty()) SetLogFile(capture_filename.c_str()); string existingLog = RDCGETLOGFILE(); - FileIO::Copy(existingLog.c_str(), logging_filename.c_str(), true); - RDCLOGFILE(logging_filename.c_str()); + FileIO::Copy(existingLog.c_str(), m_LoggingFilename.c_str(), true); + RDCLOGFILE(m_LoggingFilename.c_str()); } if(IsReplayApp()) @@ -262,6 +262,8 @@ RenderDoc::~RenderDoc() RDCLOG("'Leaking' unretrieved capture %s", m_Captures[i].path.c_str()); } } + + FileIO::Delete(m_LoggingFilename.c_str()); m_RemoteServerThreadShutdown = true; // don't join, just close the thread, as we can't wait while in the middle of module unloading @@ -270,7 +272,7 @@ RenderDoc::~RenderDoc() Network::Shutdown(); - RDCLOGDELETE(); + FileIO::Delete(m_LoggingFilename.c_str()); } void RenderDoc::StartFrameCapture(void *wnd) diff --git a/renderdoc/core/core.h b/renderdoc/core/core.h index 563197be0..5414d56a3 100644 --- a/renderdoc/core/core.h +++ b/renderdoc/core/core.h @@ -279,6 +279,8 @@ class RenderDoc vector m_FocusKeys; vector m_CaptureKeys; + string m_LoggingFilename; + string m_Target; string m_LogFile; string m_CurrentLogFile;