fix assertion
Assertion '_elementPool.CurrentAllocs() == _elementPool.Untracked()' failed.
The description doesn't seem to match the change. What's the intended change for this PR?
there is a code block
#ifdef TINYXML2_DEBUG
if ( !hadError ) {
TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() );
TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() );
TIXMLASSERT( _textPool.CurrentAllocs() == _textPool.Untracked() );
TIXMLASSERT( _commentPool.CurrentAllocs() == _commentPool.Untracked() );
}
#endif
i compile the code with TINYXML2_DEBUG=ON, and i use one XMLDocument object to parse several files, for example one.xml, two.xml and three.xml. if one.xml is wrong-format and two.xml is right-format, it will assert failed at that block while parsing three.xml.
I see, I think. That code does look suspect.
- Did you mean to provide
"resources/xmltest-5330.xml? - Why did you remove the "file doesn't exist" test, instead of just adding a new one?
I added a new one, pls help to check, i have tested for it.