diff --git a/Source/Core/UICommon/CommandLineParse.cpp b/Source/Core/UICommon/CommandLineParse.cpp index 5a12d62997..0794546db5 100644 --- a/Source/Core/UICommon/CommandLineParse.cpp +++ b/Source/Core/UICommon/CommandLineParse.cpp @@ -114,13 +114,13 @@ std::unique_ptr CreateParser(ParserOptions options) static void AddConfigLayer(const optparse::Values& options) { + std::list config_args; if (options.is_set_by_user("config")) - { - const std::list& config_args = options.all("config"); - Config::AddLayer(std::make_unique( - config_args, static_cast(options.get("video_backend")), - static_cast(options.get("audio_emulation")))); - } + config_args = options.all("config"); + + Config::AddLayer(std::make_unique( + std::move(config_args), static_cast(options.get("video_backend")), + static_cast(options.get("audio_emulation")))); } optparse::Values& ParseArguments(optparse::OptionParser* parser, int argc, char** argv)