From f8b156ac14be086f15608029e3c22ca99a82b3b1 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 20 Dec 2018 10:34:12 +0100 Subject: [PATCH] thread-loop: fix leak of event Destroy the event when the loop is destroyed --- src/pipewire/thread-loop.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pipewire/thread-loop.c b/src/pipewire/thread-loop.c index 201e3b7a9..77b860356 100644 --- a/src/pipewire/thread-loop.c +++ b/src/pipewire/thread-loop.c @@ -151,13 +151,15 @@ void pw_thread_loop_destroy(struct pw_thread_loop *loop) pw_thread_loop_stop(loop); - free(loop->name); - pthread_mutex_destroy(&loop->lock); - pthread_cond_destroy(&loop->cond); - pthread_cond_destroy(&loop->accept_cond); - spa_hook_remove(&loop->hook); + pw_loop_destroy_source(loop->loop, loop->event); + + pthread_cond_destroy(&loop->accept_cond); + pthread_cond_destroy(&loop->cond); + pthread_mutex_destroy(&loop->lock); + + free(loop->name); free(loop); }