Commit bf0cc7be authored by Milo Yip's avatar Milo Yip

Fixed a bug for SchemaDocument move constructor

parent 7c4e511e
...@@ -1339,6 +1339,7 @@ public: ...@@ -1339,6 +1339,7 @@ public:
allocator_(allocator), allocator_(allocator),
ownAllocator_(), ownAllocator_(),
root_(), root_(),
typeless_(),
schemaMap_(allocator, kInitialSchemaMapSize), schemaMap_(allocator, kInitialSchemaMapSize),
schemaRef_(allocator, kInitialSchemaRefSize) schemaRef_(allocator, kInitialSchemaRefSize)
{ {
...@@ -1398,8 +1399,10 @@ public: ...@@ -1398,8 +1399,10 @@ public:
while (!schemaMap_.Empty()) while (!schemaMap_.Empty())
schemaMap_.template Pop<SchemaEntry>(1)->~SchemaEntry(); schemaMap_.template Pop<SchemaEntry>(1)->~SchemaEntry();
typeless_->~SchemaType(); if (typeless_) {
Allocator::Free(typeless_); typeless_->~SchemaType();
Allocator::Free(typeless_);
}
RAPIDJSON_DELETE(ownAllocator_); RAPIDJSON_DELETE(ownAllocator_);
} }
......
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