Logging: add log overload which copies filename

This is needed to fix a Valgrind error in the test-cases, due to logging
Nasal filenames which are GCed.
This commit is contained in:
James Turner
2020-08-04 11:58:05 +01:00
committed by Automatic Release Builder
parent 6387a1d6d0
commit fcd75cfae5
2 changed files with 25 additions and 3 deletions
+8
View File
@@ -129,6 +129,14 @@ public:
void log( sgDebugClass c, sgDebugPriority p,
const char* fileName, int line, const std::string& msg);
// overload of above, which can transfer ownership of the file-name.
// this is unecesary overhead when logging from C++, since __FILE__ points
// to constant data, but it's needed when the filename is Nasal data (for
// example) since during shutdown the filename is freed by Nasal GC
// asynchronously with the logging thread.
void logCopyingFilename( sgDebugClass c, sgDebugPriority p,
const char* fileName, int line, const std::string& msg);
/**
* output formatted hex dump of memory block
*/