From 66487eb8f9b8fbe02aba91b2e5acaa2c89be2d61 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Mon, 20 Jul 2015 18:21:04 +0300 Subject: [PATCH] Document consistency asserts --- tinyxml2.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tinyxml2.h b/tinyxml2.h index 0b86006..6c4300a 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -630,10 +630,12 @@ public: /// Get the XMLDocument that owns this XMLNode. const XMLDocument* GetDocument() const { + TIXMLASSERT( _document ); return _document; } /// Get the XMLDocument that owns this XMLNode. XMLDocument* GetDocument() { + TIXMLASSERT( _document ); return _document; } @@ -1536,9 +1538,11 @@ public: ~XMLDocument(); virtual XMLDocument* ToDocument() { + TIXMLASSERT( this == _document ); return this; } virtual const XMLDocument* ToDocument() const { + TIXMLASSERT( this == _document ); return this; }