From f930874d00aa264ac7f148fbe06cf6be38cf4435 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Fri, 25 Jun 2021 19:39:07 +0200 Subject: [PATCH] sip: provider: Keep provider alive while there are still origins CallsSipOrigin accesses the CallsSipContext (owned by the provider) in its dispose() which will be invalid once CallsSipProvider gets freed. This commit will make certain that the provider stays alive for the lifetime of it's origins. --- plugins/sip/calls-sip-provider.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/sip/calls-sip-provider.c b/plugins/sip/calls-sip-provider.c index 473530a..096c164 100644 --- a/plugins/sip/calls-sip-provider.c +++ b/plugins/sip/calls-sip-provider.c @@ -363,6 +363,8 @@ add_account (CallsAccountProvider *acc_provider, self = CALLS_SIP_PROVIDER (acc_provider); + g_object_ref (acc_provider); + return !!calls_sip_provider_add_origin (self, credentials, 0, FALSE); } @@ -391,6 +393,8 @@ remove_account (CallsAccountProvider *acc_provider, g_hash_table_remove (self->credentials, credentials); g_list_store_remove (self->origins, position); + g_object_unref (acc_provider); + return TRUE; }