Bug 798812 - crashes after I open a customer report and select…

Edit/Report Options

As a result of auto instead of auto& in a std::visit call which
resulted in a temporary option whose GncOwner* was destroyed before
we could use it.
This commit is contained in:
John Ralls committed 2023-04-15 13:29:40 -07:00
1 parent 96c8cb738c
commit f4f481fe38
1 file changed
+2 -2
+2 -2
View File
@@ -47,7 +47,7 @@ template <typename ValueType> ValueType
GncOption::get_value() const
{
return std::visit(
[](const auto option)->ValueType {
[](const auto& option)->ValueType {
if constexpr (is_same_decayed_v<decltype(option.get_value()),
ValueType>)
return option.get_value();
@@ -80,7 +80,7 @@ template <typename ValueType> ValueType
GncOption::get_default_value() const
{
return std::visit(
[](const auto option)->ValueType {
[](const auto& option)->ValueType {
if constexpr (is_same_decayed_v<decltype(option.get_value()),
ValueType>)
return option.get_default_value();