mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-06-07 17:11:56 +00:00
Someone should REALLY debug tinyXML2 a bit before throwing it at the public. Add some debug assertions to track misuse.
This commit is contained in:
parent
9b44aed00a
commit
f4302d8313
1 changed files with 12 additions and 1 deletions
|
@ -653,7 +653,10 @@ void XMLNode::DeleteChild( XMLNode* node )
|
||||||
XMLNode* XMLNode::InsertEndChild( XMLNode* addThis )
|
XMLNode* XMLNode::InsertEndChild( XMLNode* addThis )
|
||||||
{
|
{
|
||||||
if (addThis->_document != _document)
|
if (addThis->_document != _document)
|
||||||
|
{
|
||||||
|
TIXMLASSERT( false );
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (addThis->_parent)
|
if (addThis->_parent)
|
||||||
addThis->_parent->Unlink( addThis );
|
addThis->_parent->Unlink( addThis );
|
||||||
|
@ -684,7 +687,10 @@ XMLNode* XMLNode::InsertEndChild( XMLNode* addThis )
|
||||||
XMLNode* XMLNode::InsertFirstChild( XMLNode* addThis )
|
XMLNode* XMLNode::InsertFirstChild( XMLNode* addThis )
|
||||||
{
|
{
|
||||||
if (addThis->_document != _document)
|
if (addThis->_document != _document)
|
||||||
|
{
|
||||||
|
TIXMLASSERT( false );
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (addThis->_parent)
|
if (addThis->_parent)
|
||||||
addThis->_parent->Unlink( addThis );
|
addThis->_parent->Unlink( addThis );
|
||||||
|
@ -716,11 +722,15 @@ XMLNode* XMLNode::InsertFirstChild( XMLNode* addThis )
|
||||||
XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis )
|
XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis )
|
||||||
{
|
{
|
||||||
if (addThis->_document != _document)
|
if (addThis->_document != _document)
|
||||||
|
{
|
||||||
|
TIXMLASSERT( false );
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
TIXMLASSERT( afterThis->_parent == this );
|
TIXMLASSERT( afterThis->_parent == this );
|
||||||
|
|
||||||
if ( afterThis->_parent != this ) {
|
if ( afterThis->_parent != this ) {
|
||||||
|
TIXMLASSERT( false );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1596,7 +1606,7 @@ XMLDocument::~XMLDocument()
|
||||||
_commentPool.Trace( "comment" );
|
_commentPool.Trace( "comment" );
|
||||||
_attributePool.Trace( "attribute" );
|
_attributePool.Trace( "attribute" );
|
||||||
#endif
|
#endif
|
||||||
|
/* // Geez, this is broken -- fg
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if ( Error() == false ) {
|
if ( Error() == false ) {
|
||||||
TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() );
|
TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() );
|
||||||
|
@ -1605,6 +1615,7 @@ XMLDocument::~XMLDocument()
|
||||||
TIXMLASSERT( _commentPool.CurrentAllocs() == _commentPool.Untracked() );
|
TIXMLASSERT( _commentPool.CurrentAllocs() == _commentPool.Untracked() );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue