moved xmlCleanupThreads() to the end of xmlCleanupParser() to avoid bug

* parser.c: moved xmlCleanupThreads() to the end of xmlCleanupParser()
  to avoid bug #127851
Daniel
diff --git a/ChangeLog b/ChangeLog
index 78a9af0..d2f1604 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Nov 25 08:00:15 CET 2003 Daniel Veillard <daniel@veillard.com>
+
+	* parser.c: moved xmlCleanupThreads() to the end of xmlCleanupParser()
+	  to avoid bug #127851
+
 Mon Nov 24 15:26:21 CET 2003 Daniel Veillard <daniel@veillard.com>
 
 	* xmlregexp.c: fixing some Negative Character Group and
diff --git a/parser.c b/parser.c
index d1cb2e2..49ef8eb 100644
--- a/parser.c
+++ b/parser.c
@@ -12104,9 +12104,9 @@
 #ifdef LIBXML_OUTPUT_ENABLED
     xmlCleanupOutputCallbacks();
 #endif
-    xmlCleanupThreads();
     xmlCleanupGlobals();
     xmlResetLastError();
+    xmlCleanupThreads(); /* must be last if called not from the main thread */
     xmlParserInitialized = 0;
 }