summaryrefslogtreecommitdiff
path: root/FreeFileSync/Source/ffs_paths.cpp
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-12-08 08:13:55 -0500
committerB Stack <bgstack15@gmail.com>2020-12-08 08:13:55 -0500
commitdae91af92db2b316cec2db17328e92306b915753 (patch)
tree8e5414c3b8a914f57a1d4dc92ee0e55ae1f6e9ee /FreeFileSync/Source/ffs_paths.cpp
parentMerge branch '11.3' into 'master' (diff)
downloadFreeFileSync-dae91af92db2b316cec2db17328e92306b915753.tar.gz
FreeFileSync-dae91af92db2b316cec2db17328e92306b915753.tar.bz2
FreeFileSync-dae91af92db2b316cec2db17328e92306b915753.zip
add upstream 11.4
Diffstat (limited to 'FreeFileSync/Source/ffs_paths.cpp')
-rw-r--r--FreeFileSync/Source/ffs_paths.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/FreeFileSync/Source/ffs_paths.cpp b/FreeFileSync/Source/ffs_paths.cpp
index e728c54b..3b058270 100644
--- a/FreeFileSync/Source/ffs_paths.cpp
+++ b/FreeFileSync/Source/ffs_paths.cpp
@@ -43,16 +43,11 @@ Zstring getProcessParentFolderPath()
-namespace
-{
-//don't make this a function-scope static (avoid code-gen for "magic static")
//getFfsVolumeId() might be called during static destruction, e.g. async update check
-std::once_flag onceFlagGetFfsVolumeId;
-}
-
VolumeId fff::getFfsVolumeId() //throw FileError
{
static VolumeId volumeId; //POD => no "magic static" code gen
+ static constinit2 std::once_flag onceFlagGetFfsVolumeId; //=> no "magic static" code gen
std::call_once(onceFlagGetFfsVolumeId, [] { volumeId = getVolumeId(getProcessPath()); }); //throw FileError
return volumeId;
}
bgstack15