mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #561 from Dmitry-Me/unlinkedElementsAssertions
Unlinked nodes assertions
This commit is contained in:
commit
275067a91f
|
@ -1994,6 +1994,7 @@ XMLDocument::~XMLDocument()
|
|||
|
||||
void XMLDocument::MarkInUse(XMLNode* node)
|
||||
{
|
||||
TIXMLASSERT(node);
|
||||
TIXMLASSERT(node->_parent == 0);
|
||||
|
||||
for (int i = 0; i < _unlinked.Size(); ++i) {
|
||||
|
|
|
@ -265,8 +265,8 @@ public:
|
|||
}
|
||||
|
||||
void SwapRemove(int i) {
|
||||
TIXMLASSERT(i >= 0);
|
||||
TIXMLASSERT(i < _size);
|
||||
TIXMLASSERT(i >= 0 && i < _size);
|
||||
TIXMLASSERT(_size > 0);
|
||||
_mem[i] = _mem[_size - 1];
|
||||
--_size;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue