diff --git a/daemon/call.c b/daemon/call.c index f49432a78..cde9bc43f 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -3325,6 +3325,10 @@ void call_media_free(struct call_media **mdp) { *mdp = NULL; } +void call_subscription_free(void *p) { + g_slice_free1(sizeof(struct call_subscription), p); +} + static void __call_free(void *p) { struct call *c = p; struct call_monologue *m; @@ -3352,6 +3356,8 @@ static void __call_free(void *p) { sdp_streams_free(&m->last_in_sdp_streams); g_hash_table_destroy(m->subscribers_ht); g_hash_table_destroy(m->subscriptions_ht); + g_queue_clear_full(&m->subscribers, call_subscription_free); + g_queue_clear_full(&m->subscriptions, call_subscription_free); g_slice_free1(sizeof(*m), m); } diff --git a/include/call.h b/include/call.h index 07ff84953..25804e1f6 100644 --- a/include/call.h +++ b/include/call.h @@ -561,6 +561,8 @@ void __add_subscription(struct call_monologue *ml, struct call_monologue *other, void free_sink_handler(void *); void __add_sink_handler(GQueue *, struct packet_stream *); +void call_subscription_free(void *); + struct call *call_get_or_create(const str *callid, bool foreign, bool exclusive); struct call *call_get_opmode(const str *callid, enum call_opmode opmode);