🐛 fix leak for strings

parent 149ded85
......@@ -236,6 +236,7 @@ template<typename BasicJsonType, typename CompatibleString,
enable_if_t<std::is_constructible<typename BasicJsonType::string_t, CompatibleString>::value, int> = 0>
void to_json(BasicJsonType& j, const CompatibleString& s)
{
j.m_value.destroy(j.m_type);
external_constructor<value_t::string>::construct(j, s);
}
......
......@@ -4694,6 +4694,7 @@ template<typename BasicJsonType, typename CompatibleString,
enable_if_t<std::is_constructible<typename BasicJsonType::string_t, CompatibleString>::value, int> = 0>
void to_json(BasicJsonType& j, const CompatibleString& s)
{
j.m_value.destroy(j.m_type);
external_constructor<value_t::string>::construct(j, s);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment