Fixed a bug for SchemaDocument move constructor

This commit is contained in:
Milo Yip 2016-10-18 13:53:00 +08:00
parent 7c4e511eb0
commit bf0cc7bea8

View File

@ -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:
while (!schemaMap_.Empty()) while (!schemaMap_.Empty())
schemaMap_.template Pop<SchemaEntry>(1)->~SchemaEntry(); schemaMap_.template Pop<SchemaEntry>(1)->~SchemaEntry();
if (typeless_) {
typeless_->~SchemaType(); typeless_->~SchemaType();
Allocator::Free(typeless_); Allocator::Free(typeless_);
}
RAPIDJSON_DELETE(ownAllocator_); RAPIDJSON_DELETE(ownAllocator_);
} }