From e50ca7adedaa059fb0bd4c5b0d9281db2cfd91be Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 1 Feb 2021 13:31:28 +0100 Subject: [PATCH] Try a fix against random crashes at startup when loading configuration --- ext/ghoul | 2 +- src/engine/configuration.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index e42b3f58c4..1750e592bb 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit e42b3f58c493d57afde415cf5be8af88585c320b +Subproject commit 1750e592bb64e2fe759b75e447a9a6aae2d7c3c7 diff --git a/src/engine/configuration.cpp b/src/engine/configuration.cpp index 9b948e911c..35727a3790 100644 --- a/src/engine/configuration.cpp +++ b/src/engine/configuration.cpp @@ -147,7 +147,7 @@ namespace { for (size_t i = 1; i <= d.size(); ++i) { res.push_back(d.value(std::to_string(i))); } - value = res; + value = std::move(res); } // NOLINTNEXTLINE else if constexpr (std::is_same_v>) { @@ -160,7 +160,7 @@ namespace { std::string v = d.value(key); res[std::string(key)] = std::move(v); } - value = res; + value = std::move(res); } // NOLINTNEXTLINE else if constexpr (std::is_same_v>) { @@ -173,7 +173,7 @@ namespace { ghoul::Dictionary v = d.value(key); res[std::string(key)] = std::move(v); } - value = res; + value = std::move(res); } // NOLINTNEXTLINE else if constexpr (std::is_same_v) { @@ -256,7 +256,10 @@ namespace { filter.type = fi.value(KeyType); } - res.push_back(filter); + auto fff = filter; + const auto ffg = filter; + + res.push_back(std::move(filter)); } v.identifierFilters = res;