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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user