Document consistency asserts
diff --git a/tinyxml2.h b/tinyxml2.h
index 0b86006..6c4300a 100755
--- a/tinyxml2.h
+++ b/tinyxml2.h
@@ -630,10 +630,12 @@
/// 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 @@
~XMLDocument();
virtual XMLDocument* ToDocument() {
+ TIXMLASSERT( this == _document );
return this;
}
virtual const XMLDocument* ToDocument() const {
+ TIXMLASSERT( this == _document );
return this;
}