1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-12 07:37:35 +00:00

manager: Temporarily hold a reference to provider being unloaded

This commit is contained in:
Evangelos Ribeiro Tzaras 2021-07-07 16:12:23 +02:00 committed by Evangelos Ribeiro Tzaras
parent 2b31a9677e
commit d5bf31bdaf

View file

@ -379,13 +379,16 @@ remove_provider (CallsManager *self,
{
GListModel *origins;
guint n_items;
CallsProvider *provider;
g_autoptr (CallsProvider) provider;
g_assert (CALLS_IS_MANAGER (self));
g_assert (name);
provider = g_hash_table_lookup (self->providers, name);
if (provider == NULL) {
if (provider) {
/* Hold a ref since g_hash_table_remove () might drop the last one */
g_object_ref (provider);
} else {
g_warning ("Trying to remove provider %s which has not been found", name);
return;
}