From e6e02bb521bee535bd3c8083214bf565000a1344 Mon Sep 17 00:00:00 2001 From: Quinton Miller Date: Wed, 10 Jan 2024 00:06:47 +0800 Subject: [PATCH] Always call `LibXML.xmlInitParser` when requiring XML files --- src/xml/libxml2.cr | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/xml/libxml2.cr b/src/xml/libxml2.cr index 3dff7fb6cb40..feea8a1ba6d7 100644 --- a/src/xml/libxml2.cr +++ b/src/xml/libxml2.cr @@ -11,9 +11,10 @@ require "./save_options" lib LibXML alias Int = LibC::Int + fun xmlInitParser + # TODO: check if other platforms also support per-thread globals {% if flag?(:win32) %} - fun xmlInitParser fun __xmlIndentTreeOutput : Int* fun __xmlTreeIndentString : UInt8** {% else %} @@ -324,9 +325,7 @@ lib LibXML fun xmlValidateNameValue(value : UInt8*) : Int end -{% if flag?(:win32) %} - LibXML.xmlInitParser -{% end %} +LibXML.xmlInitParser LibXML.xmlGcMemSetup( ->GC.free,