From 83c5446d852178794450f7c5833f7a047490ff31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 14 Jan 2022 00:04:22 +0100 Subject: Fix static initialisation order fiasco issue for Version variables Fixes a crash that could occur if the static constructor function for the MainSettings.cpp TU happened to run before the variables in Common/Version.cpp are initialised. (This is known as the static initialisation order fiasco.) By using wrapper functions, those variables are now guaranteed to be constructed on first use. --- Source/Core/UICommon/CommandLineParse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/UICommon/CommandLineParse.cpp') diff --git a/Source/Core/UICommon/CommandLineParse.cpp b/Source/Core/UICommon/CommandLineParse.cpp index 7ac1bafe36..54093f219a 100644 --- a/Source/Core/UICommon/CommandLineParse.cpp +++ b/Source/Core/UICommon/CommandLineParse.cpp @@ -78,7 +78,7 @@ private: std::unique_ptr CreateParser(ParserOptions options) { auto parser = std::make_unique(); - parser->usage("usage: %prog [options]... [FILE]...").version(Common::scm_rev_str); + parser->usage("usage: %prog [options]... [FILE]...").version(Common::GetScmRevStr()); parser->add_option("-u", "--user").action("store").help("User folder path"); parser->add_option("-m", "--movie").action("store").help("Play a movie file"); -- cgit v1.2.3