summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2012-09-18 18:33:55 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-09-18 18:57:52 -0400
commit7226a48a8cff5637b865b64e39a6a937c20e7677 (patch)
treeb02d05fd8044293be5881d0300203cc4ef5e711d /parse-xml.c
parent0cf3a11645c8884d4e7b3b917ce5f983fbd7ff8c (diff)
downloadsubsurface-7226a48a8cff5637b865b64e39a6a937c20e7677.tar.gz
Call xmlCleanupParser only once - when we are done with libxml
Calling xmlCleanupParser in parse-xml.c:parse_xml_buffer() caused massive memory corruption mostly affecting gtk's FileChooser dialogs and the application menu. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/parse-xml.c b/parse-xml.c
index f47ac5a26..2a10792f8 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -1497,7 +1497,6 @@ void parse_xml_buffer(const char *url, const char *buffer, int size, GError **er
traverse(xmlDocGetRootElement(doc));
dive_end();
xmlFreeDoc(doc);
- xmlCleanupParser();
}
void parse_xml_init(void)
@@ -1505,6 +1504,11 @@ void parse_xml_init(void)
LIBXML_TEST_VERSION
}
+void parse_xml_exit(void)
+{
+ xmlCleanupParser();
+}
+
#ifdef XSLT
/* Maybe we'll want a environment variable that can override this.. */