Răsfoiți Sursa

Don't leak the element

Dmitry-Me 11 ani în urmă
părinte
comite
5daa54cf2b
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  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" );
 		XMLPrinter 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