🐛 fix leak for strings
This commit is contained in:
parent
6cbdc83994
commit
c1298e69a6
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user