mirror of
https://github.com/AxioDL/tinyxml2.git
synced 2025-05-14 11:21:38 +00:00
Merge pull request #317 from Dmitry-Me/moreConsistencyAsserts
More consistency asserts
This commit is contained in:
commit
2d39158eaa
@ -662,6 +662,7 @@ void XMLNode::SetValue( const char* str, bool staticMem )
|
|||||||
void XMLNode::DeleteChildren()
|
void XMLNode::DeleteChildren()
|
||||||
{
|
{
|
||||||
while( _firstChild ) {
|
while( _firstChild ) {
|
||||||
|
TIXMLASSERT( _lastChild );
|
||||||
TIXMLASSERT( _firstChild->_document == _document );
|
TIXMLASSERT( _firstChild->_document == _document );
|
||||||
XMLNode* node = _firstChild;
|
XMLNode* node = _firstChild;
|
||||||
Unlink( node );
|
Unlink( node );
|
||||||
@ -676,6 +677,7 @@ void XMLNode::Unlink( XMLNode* child )
|
|||||||
{
|
{
|
||||||
TIXMLASSERT( child );
|
TIXMLASSERT( child );
|
||||||
TIXMLASSERT( child->_document == _document );
|
TIXMLASSERT( child->_document == _document );
|
||||||
|
TIXMLASSERT( child->_parent == this );
|
||||||
if ( child == _firstChild ) {
|
if ( child == _firstChild ) {
|
||||||
_firstChild = _firstChild->_next;
|
_firstChild = _firstChild->_next;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user