Skip to content

Commit

Permalink
Wrap GenericSchemaValidator to destruct the validator first
Browse files Browse the repository at this point in the history
  • Loading branch information
junwha committed Dec 26, 2023
1 parent b3aa1f5 commit 7c4d5f0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/perftest/schematest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,14 @@ TEST_F(Schema, TestSuite) {
for (int i = 0; i < trialCount; i++) {
for (TestSuiteList::const_iterator itr = testSuites.begin(); itr != testSuites.end(); ++itr) {
const TestSuite& ts = **itr;
GenericSchemaValidator<SchemaDocument, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<>> *validator = new GenericSchemaValidator<SchemaDocument, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<>>(*ts.schema, &validatorAllocator);
for (DocumentList::const_iterator testItr = ts.tests.begin(); testItr != ts.tests.end(); ++testItr) {
validator->Reset();
(*testItr)->Accept(*validator);
testCount++;
{
GenericSchemaValidator<SchemaDocument, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > validator(*ts.schema, &validatorAllocator);
for (DocumentList::const_iterator testItr = ts.tests.begin(); testItr != ts.tests.end(); ++testItr) {
validator->Reset();
(*testItr)->Accept(*validator);
testCount++;
}
}
delete validator;
validatorAllocator.Clear();
}
}
Expand Down

0 comments on commit 7c4d5f0

Please sign in to comment.