diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 349ec5d9a2..391c633f9e 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -581,7 +581,7 @@ std::string GetBundleDirectory() { #endif #ifdef _WIN32 -std::string& GetExeDirectory() { +const std::string& GetExeDirectory() { static std::string exe_path; if (exe_path.empty()) { wchar_t wchar_exe_path[2048]; diff --git a/src/common/file_util.h b/src/common/file_util.h index ef2f5e8dbe..4ed02f30f4 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -133,7 +133,7 @@ std::string GetBundleDirectory(); #endif #ifdef _WIN32 -std::string& GetExeDirectory(); +const std::string& GetExeDirectory(); std::string AppDataRoamingDirectory(); #endif