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:
parent
2b31a9677e
commit
d5bf31bdaf
1 changed files with 5 additions and 2 deletions
|
@ -379,13 +379,16 @@ remove_provider (CallsManager *self,
|
||||||
{
|
{
|
||||||
GListModel *origins;
|
GListModel *origins;
|
||||||
guint n_items;
|
guint n_items;
|
||||||
CallsProvider *provider;
|
g_autoptr (CallsProvider) provider;
|
||||||
|
|
||||||
g_assert (CALLS_IS_MANAGER (self));
|
g_assert (CALLS_IS_MANAGER (self));
|
||||||
g_assert (name);
|
g_assert (name);
|
||||||
|
|
||||||
provider = g_hash_table_lookup (self->providers, 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);
|
g_warning ("Trying to remove provider %s which has not been found", name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue