Commit b387761e authored by Niels's avatar Niels

forgot to destroy object

parent 568d7595
......@@ -431,7 +431,7 @@ class basic_json
}
case (value_t::string):
{
// m_value.string = new string_t(*other.m_value.string);
// m_value.string = new string_t(*other.m_value.string);
Allocator<string_t> alloc;
m_value.string = alloc.allocate(1);
alloc.construct(m_value.string, *other.m_value.string);
......@@ -500,11 +500,12 @@ class basic_json
case (value_t::string):
{
Allocator<string_t> alloc;
alloc.destroy(m_value.string);
alloc.deallocate(m_value.string, 1);
m_value.string = nullptr;
// delete m_value.string;
// m_value.string = nullptr;
// delete m_value.string;
// m_value.string = nullptr;
break;
}
......
......@@ -500,6 +500,7 @@ class basic_json
case (value_t::string):
{
Allocator<string_t> alloc;
alloc.destroy(m_value.string);
alloc.deallocate(m_value.string, 1);
m_value.string = nullptr;
......
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