summaryrefslogtreecommitdiff
path: root/utils/regtools
diff options
context:
space:
mode:
Diffstat (limited to 'utils/regtools')
-rw-r--r--utils/regtools/lib/soc_desc.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/utils/regtools/lib/soc_desc.cpp b/utils/regtools/lib/soc_desc.cpp
index 1c9eaf7972..3904f6a77e 100644
--- a/utils/regtools/lib/soc_desc.cpp
+++ b/utils/regtools/lib/soc_desc.cpp
@@ -293,7 +293,6 @@ bool soc_desc_parse_xml(const std::string& filename, soc_t& socs)
293 bool ret = parse_root_elem(root_element, socs); 293 bool ret = parse_root_elem(root_element, socs);
294 294
295 xmlFreeDoc(doc); 295 xmlFreeDoc(doc);
296 xmlCleanupParser();
297 296
298 return ret; 297 return ret;
299} 298}
@@ -967,3 +966,20 @@ bool soc_desc_evaluate_formula(const std::string& formula,
967 my_evaluator e(formula, var); 966 my_evaluator e(formula, var);
968 return e.parse(result, error); 967 return e.parse(result, error);
969} 968}
969
970/** WARNING we need to call xmlInitParser() to init libxml2 but it needs to
971 * called from the main thread, which is a super strong requirement, so do it
972 * using a static constructor */
973namespace
974{
975class xml_parser_init
976{
977public:
978 xml_parser_init()
979 {
980 xmlInitParser();
981 }
982};
983
984xml_parser_init __xml_parser_init;
985}