diff --git a/daemon/call.c b/daemon/call.c index f5b571b51..0034fe1c8 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -3328,6 +3328,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; @@ -3355,6 +3359,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 6748003fa..27cad8f2e 100644 --- a/include/call.h +++ b/include/call.h @@ -599,6 +599,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);