mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-10-26 08:00:05 -05:00
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:
1 parent
96c8cb738c
commit
f4f481fe38
1 file changed
+2
-2
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user