🐛 fix leak for strings

parent 6cbdc839
......@@ -236,7 +236,10 @@ 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);
if (!j.is_null())
{
j = nullptr;
}
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