diff options
Diffstat (limited to 'threads.c')
-rw-r--r-- | threads.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -359,6 +359,9 @@ xmlRMutexUnlock(xmlRMutexPtr tok ATTRIBUTE_UNUSED) ************************************************************************/ #ifdef LIBXML_THREAD_ENABLED +#ifdef xmlLastError +#undef xmlLastError +#endif /** * xmlFreeGlobalState: * @state: a thread global state @@ -369,8 +372,10 @@ xmlRMutexUnlock(xmlRMutexPtr tok ATTRIBUTE_UNUSED) static void xmlFreeGlobalState(void *state) { - /* free any memory allocated in the thread's xmlLastError */ - xmlResetLastError(); + xmlGlobalState *gs = (xmlGlobalState *) state; + + /* free any memory allocated in the thread's xmlLastError */ + xmlResetError(&(gs->xmlLastError)); free(state); } |