[libxml2] Fix reinitialization of library on Windows



commit 65f8a62040c87c1c58468c63bfa5e134c1fb5cc4
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Tue Jun 14 18:38:12 2022 +0200

    Fix reinitialization of library on Windows
    
    Reset the 'run_once' state in xmlCleanupThreads, so the global
    variables can be reinitialized later.
    
    While it's generally unsafe to call xmlCleanupParser and continue to
    use the library afterwards, this fix should avoid an outright crash if
    you do so on Windows. This should help with applications erroneously
    calling xmlCleanupParser.
    
    See #376.

 threads.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/threads.c b/threads.c
index c33150ea..ca43c96a 100644
--- a/threads.c
+++ b/threads.c
@@ -925,6 +925,8 @@ xmlCleanupThreads(void)
         globalkey = TLS_OUT_OF_INDEXES;
     }
     DeleteCriticalSection(&cleanup_helpers_cs);
+    run_once.done = 0;
+    run_once.control = 0;
 #endif
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]