mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
guid_to_string should be freed.
This commit is contained in:
parent
c05b59560b
commit
8e21d3328f
@ -1226,9 +1226,10 @@ inline SCM return_scm_value(ValueType value)
|
|||||||
if (guid_list.empty())
|
if (guid_list.empty())
|
||||||
return scm_simple_format(SCM_BOOL_F, list_format_str, scm_list_1(no_value));
|
return scm_simple_format(SCM_BOOL_F, list_format_str, scm_list_1(no_value));
|
||||||
SCM string_list{SCM_EOL};
|
SCM string_list{SCM_EOL};
|
||||||
|
char guid_str[GUID_ENCODING_LENGTH+1];
|
||||||
for(auto guid : guid_list)
|
for(auto guid : guid_list)
|
||||||
{
|
{
|
||||||
auto guid_str{guid_to_string(&guid)};
|
guid_to_string_buff (&guid, guid_str);
|
||||||
auto guid_scm{scm_from_utf8_string(guid_str)};
|
auto guid_scm{scm_from_utf8_string(guid_str)};
|
||||||
string_list = scm_cons(guid_scm, string_list);
|
string_list = scm_cons(guid_scm, string_list);
|
||||||
}
|
}
|
||||||
|
@ -225,7 +225,11 @@ GncSqlColumnTableEntryImpl<CT_OWNERREF>::add_to_query(QofIdTypeConst obj_name,
|
|||||||
buf.str("");
|
buf.str("");
|
||||||
auto guid = qof_instance_get_guid(inst);
|
auto guid = qof_instance_get_guid(inst);
|
||||||
if (guid != nullptr)
|
if (guid != nullptr)
|
||||||
buf << guid_to_string(guid);
|
{
|
||||||
|
char strbuff[GUID_ENCODING_LENGTH+1];
|
||||||
|
guid_to_string_buff (guid, strbuff);
|
||||||
|
buf << strbuff;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
buf << "NULL";
|
buf << "NULL";
|
||||||
vec.emplace_back(std::make_pair(guid_hdr, quote_string(buf.str())));
|
vec.emplace_back(std::make_pair(guid_hdr, quote_string(buf.str())));
|
||||||
|
@ -877,7 +877,12 @@ std::string
|
|||||||
GncOptionAccountSelValue::serialize() const noexcept
|
GncOptionAccountSelValue::serialize() const noexcept
|
||||||
{
|
{
|
||||||
static const std::string no_value{"No Value"};
|
static const std::string no_value{"No Value"};
|
||||||
return guid_equal(guid_null(), &m_value) ? no_value : guid_to_string(&m_value);
|
if (guid_equal(guid_null(), &m_value))
|
||||||
|
return no_value;
|
||||||
|
|
||||||
|
gchar strbuff[GUID_ENCODING_LENGTH + 1];
|
||||||
|
guid_to_string_buff (&m_value, strbuff);
|
||||||
|
return strbuff;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -898,7 +898,9 @@ operator<< <GncOptionAccountListValue>(std::ostream& oss,
|
|||||||
first = false;
|
first = false;
|
||||||
else
|
else
|
||||||
oss << " ";
|
oss << " ";
|
||||||
oss << guid_to_string(&value);
|
char strbuff[GUID_ENCODING_LENGTH+1];
|
||||||
|
guid_to_string_buff (&value, strbuff);
|
||||||
|
oss << strbuff;
|
||||||
}
|
}
|
||||||
return oss;
|
return oss;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user