diff --git a/daemon/aux.h b/daemon/aux.h index 745dcf8c1..a0ab09c46 100644 --- a/daemon/aux.h +++ b/daemon/aux.h @@ -153,6 +153,7 @@ typedef GStaticRWLock rwlock_t; typedef GCond *cond_t; #define mutex_init(m) g_static_mutex_init(m) +#define mutex_destroy(m) g_static_mutex_free(m) #define mutex_lock(m) g_static_mutex_lock(m) #define mutex_trylock(m) g_static_mutex_trylock(m) #define mutex_unlock(m) g_static_mutex_unlock(m) @@ -176,6 +177,7 @@ typedef GRWLock rwlock_t; typedef GCond cond_t; #define mutex_init(m) g_mutex_init(m) +#define mutex_destroy(m) g_mutex_clear(m) #define mutex_lock(m) g_mutex_lock(m) #define mutex_trylock(m) g_mutex_trylock(m) #define mutex_unlock(m) g_mutex_unlock(m) diff --git a/daemon/call.c b/daemon/call.c index 18577e641..6224687fb 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1108,6 +1108,7 @@ static void callstream_free(void *ptr) { release_port(r); } } + mutex_destroy(&s->lock); obj_put(s->call); } @@ -1465,6 +1466,7 @@ static void call_free(void *p) { free(c->called_agent); g_queue_free(c->callstreams); free(c->callid); + mutex_destroy(&c->lock); } static struct call *call_create(const char *callid, struct callmaster *m) { diff --git a/daemon/control.c b/daemon/control.c index 50c2216cd..e18108094 100644 --- a/daemon/control.c +++ b/daemon/control.c @@ -204,6 +204,7 @@ static void control_stream_free(void *p) { close(s->fd); streambuf_destroy(s->inbuf); streambuf_destroy(s->outbuf); + mutex_destroy(&s->lock); } static void control_incoming(int fd, void *p, uintptr_t u) {