From d1390c8673b178744acd6aa3a681f7b51ed9438f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 2 Mar 2023 23:41:10 +0000 Subject: Don't leak root node when parsing XML --- lib/saxParse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/saxParse.cpp b/lib/saxParse.cpp index d592a1f..5c597aa 100644 --- a/lib/saxParse.cpp +++ b/lib/saxParse.cpp @@ -11,7 +11,7 @@ namespace Persistence { void SAXParse::parseFile(FILE * file) { - mxmlSAXLoadFile( + mxmlRelease(mxmlSAXLoadFile( nullptr, file, MXML_TEXT_CALLBACK, [](mxml_node_t * n, mxml_sax_event_t e, void * data) { SAXParse * self = static_cast(data); @@ -36,6 +36,6 @@ namespace Persistence { break; } }, - this); + this)); } } -- cgit v1.2.3