Sfoglia il codice sorgente

Merge pull request #321 from Dmitry-Me/dontLeakTheElement

Don't leak the element
Lee Thomason 11 anni fa
parent
commit
9f24acd369
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      xmltest.cpp

+ 2 - 0
xmltest.cpp

@@ -1435,6 +1435,8 @@ int main( int argc, const char ** argv )
 		XMLElement* newElement = doc.NewElement( "printme" );
 		XMLElement* newElement = doc.NewElement( "printme" );
 		XMLPrinter printer;
 		XMLPrinter printer;
 		newElement->Accept( &printer );
 		newElement->Accept( &printer );
+		// Delete the node to avoid possible memory leak report in debug output
+		doc.DeleteNode( newElement );
 	}
 	}
 	{
 	{
 		// Issue 302. Clear errors from LoadFile/SaveFile
 		// Issue 302. Clear errors from LoadFile/SaveFile