diff options
| -rw-r--r-- | source/core/slang-io.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/core/slang-io.cpp b/source/core/slang-io.cpp index 3e0aa22a3..6cdd75c74 100644 --- a/source/core/slang-io.cpp +++ b/source/core/slang-io.cpp @@ -549,8 +549,12 @@ namespace Slang /* static */String Path::getExecutablePath() { - static String executablePath = _getExecutablePath(); - return executablePath; + // TODO(JS): It would be better if we lazily evaluated this, and then returned the same string on subsequent calls, because it has to do + // a fair amount of work depending on target. + // This was how previous code worked, with a static variable. Unfortunately this led to a memory leak being reported - because reporting + // is done before a global variable is released. + // It would be good to have a mechanism that allows 'core' library source free memory in some controlled manner. + return _getExecutablePath(); } Slang::String File::readAllText(const Slang::String& fileName) |
