mirror of
https://gitlab.gnome.org/GNOME/libsecret.git
synced 2024-12-22 20:58:52 +00:00
secret-backend: Add a way to uncache singleton instance
This is ugly, but necessary to handle instance uncaching in SecretBackend when the backend instance is gone.
This commit is contained in:
parent
71a19a95ae
commit
b37d2b8d20
@ -122,6 +122,20 @@ backend_get_instance (void)
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_secret_backend_uncache_instance (void)
|
||||||
|
{
|
||||||
|
SecretBackend *instance = NULL;
|
||||||
|
|
||||||
|
G_LOCK (backend_instance);
|
||||||
|
instance = backend_instance;
|
||||||
|
backend_instance = NULL;
|
||||||
|
G_UNLOCK (backend_instance);
|
||||||
|
|
||||||
|
if (instance != NULL)
|
||||||
|
g_object_unref (instance);
|
||||||
|
}
|
||||||
|
|
||||||
static GType
|
static GType
|
||||||
backend_get_impl_type (void)
|
backend_get_impl_type (void)
|
||||||
{
|
{
|
||||||
|
@ -97,6 +97,8 @@ struct _SecretBackendInterface
|
|||||||
|
|
||||||
void _secret_backend_ensure_extension_point
|
void _secret_backend_ensure_extension_point
|
||||||
(void);
|
(void);
|
||||||
|
void _secret_backend_uncache_instance
|
||||||
|
(void);
|
||||||
|
|
||||||
void secret_backend_get (SecretBackendFlags flags,
|
void secret_backend_get (SecretBackendFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
|
@ -191,6 +191,8 @@ service_uncache_instance (SecretService *which)
|
|||||||
if (watch != 0)
|
if (watch != 0)
|
||||||
g_bus_unwatch_name (watch);
|
g_bus_unwatch_name (watch);
|
||||||
|
|
||||||
|
_secret_backend_uncache_instance ();
|
||||||
|
|
||||||
return matched;
|
return matched;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user