Fix memory leak

This commit is contained in:
Milo Yip 2016-01-27 14:17:24 +08:00
parent d72f52bbea
commit 63ae3b730a

View File

@ -1505,6 +1505,7 @@ public:
~GenericSchemaValidator() { ~GenericSchemaValidator() {
Reset(); Reset();
RAPIDJSON_DELETE(ownStateAllocator_);
} }
void Reset() { void Reset() {
@ -1693,7 +1694,7 @@ private:
void CreateOwnAllocator() { void CreateOwnAllocator() {
if (!stateAllocator_) if (!stateAllocator_)
stateAllocator_ = ownStateAllocator_ = new StateAllocator; stateAllocator_ = ownStateAllocator_ = RAPIDJSON_NEW(StateAllocator());
} }
bool BeginValue() { bool BeginValue() {