Skip to content

Commit

Permalink
MT#55283 introduce __monologue_free
Browse files Browse the repository at this point in the history
Change-Id: I5273abebba5b73b281c6f02b34d2bd39d5b40d1d
  • Loading branch information
rfuchs committed Aug 18, 2023
1 parent 19a0b93 commit d9131bf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
33 changes: 18 additions & 15 deletions daemon/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -3688,6 +3688,23 @@ void call_subscription_free(void *p) {
g_slice_free1(sizeof(struct call_subscription), p);
}

void __monologue_free(struct call_monologue *m) {
g_ptr_array_free(m->medias, true);
g_hash_table_destroy(m->associated_tags);
g_hash_table_destroy(m->media_ids);
free_ssrc_hash(&m->ssrc_hash);
if (m->last_out_sdp)
g_string_free(m->last_out_sdp, TRUE);
str_free_dup(&m->last_in_sdp);
sdp_free(&m->last_in_sdp_parsed);
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);
}

static void __call_free(void *p) {
struct call *c = p;
struct call_monologue *m;
Expand All @@ -3703,21 +3720,7 @@ static void __call_free(void *p) {

while (c->monologues.head) {
m = g_queue_pop_head(&c->monologues);

g_ptr_array_free(m->medias, true);
g_hash_table_destroy(m->associated_tags);
g_hash_table_destroy(m->media_ids);
free_ssrc_hash(&m->ssrc_hash);
if (m->last_out_sdp)
g_string_free(m->last_out_sdp, TRUE);
str_free_dup(&m->last_in_sdp);
sdp_free(&m->last_in_sdp_parsed);
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);
__monologue_free(m);
}

while (c->medias.head) {
Expand Down
1 change: 1 addition & 0 deletions include/call.h
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@ int call_init(void);
void call_free(void);

struct call_monologue *__monologue_create(struct call *call);
void __monologue_free(struct call_monologue *m);
void __monologue_tag(struct call_monologue *ml, const str *tag);
void __monologue_viabranch(struct call_monologue *ml, const str *viabranch);
struct packet_stream *__packet_stream_new(struct call *call);
Expand Down

0 comments on commit d9131bf

Please sign in to comment.