Skip to content

Commit

Permalink
Create the GncOptionVariant's GncOptionValue in place.
Browse files Browse the repository at this point in the history
Saves a temporary, prevents premature unprotecting of Scheme objects.
  • Loading branch information
jralls committed Aug 1, 2021
1 parent c034a26 commit f5d8d50
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libgnucash/app-utils/gnc-option.cpp
Expand Up @@ -40,8 +40,9 @@ template <typename ValueType,
GncOption::GncOption(const char* section, const char* name,
const char* key, const char* doc_string,
ValueType value, GncOptionUIType ui_type) :
m_option{std::make_unique<GncOptionVariant>(GncOptionValue<ValueType> {
section, name, key, doc_string, value, ui_type})}
m_option{std::make_unique<GncOptionVariant>(
std::in_place_type<GncOptionValue<ValueType>>,
section, name, key, doc_string, value, ui_type)}
{
}

Expand Down

0 comments on commit f5d8d50

Please sign in to comment.