Commit 03753799 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

libvlc: pop_listener does not do its job.

Pointed by Laurent and Valgrind.
parent b8711965
...@@ -133,15 +133,19 @@ static void pop_listener(libvlc_event_manager_t * p_em, libvlc_event_listener_t ...@@ -133,15 +133,19 @@ static void pop_listener(libvlc_event_manager_t * p_em, libvlc_event_listener_t
while (iter) { while (iter) {
if(listeners_are_equal(&iter->listener, listener)) if(listeners_are_equal(&iter->listener, listener))
{ {
struct queue_elmt * to_delete = iter;
if(!prev) if(!prev)
queue(p_em)->elements = iter->next; queue(p_em)->elements = to_delete->next;
else else
prev->next = iter->next; prev->next = to_delete->next;
free(iter); iter = to_delete->next;
free(to_delete);
} }
else {
prev = iter; prev = iter;
iter = iter->next; iter = iter->next;
} }
}
} }
/************************************************************************** /**************************************************************************
......
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