Commit 1476c5ee authored by Sébastien Escudier's avatar Sébastien Escudier

fix win32 threadvar linked list

parent d7f64384
...@@ -495,6 +495,9 @@ int vlc_threadvar_create (vlc_threadvar_t *p_tls, void (*destr) (void *)) ...@@ -495,6 +495,9 @@ int vlc_threadvar_create (vlc_threadvar_t *p_tls, void (*destr) (void *))
vlc_mutex_lock (&super_mutex); vlc_mutex_lock (&super_mutex);
var->prev = vlc_threadvar_last; var->prev = vlc_threadvar_last;
if (var->prev)
var->prev->next = var;
vlc_threadvar_last = var; vlc_threadvar_last = var;
vlc_mutex_unlock (&super_mutex); vlc_mutex_unlock (&super_mutex);
return 0; return 0;
...@@ -507,10 +510,12 @@ void vlc_threadvar_delete (vlc_threadvar_t *p_tls) ...@@ -507,10 +510,12 @@ void vlc_threadvar_delete (vlc_threadvar_t *p_tls)
vlc_mutex_lock (&super_mutex); vlc_mutex_lock (&super_mutex);
if (var->prev != NULL) if (var->prev != NULL)
var->prev->next = var->next; var->prev->next = var->next;
else
vlc_threadvar_last = var->next;
if (var->next != NULL) if (var->next != NULL)
var->next->prev = var->prev; var->next->prev = var->prev;
else
vlc_threadvar_last = var->prev;
vlc_mutex_unlock (&super_mutex); vlc_mutex_unlock (&super_mutex);
TlsFree (var->id); TlsFree (var->id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment