From eae69e33dd1865f24544c135b366eb343c5a46e6 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 23 Aug 2019 07:45:41 +0200 Subject: core: extend nm_shutdown_wait_obj_*() to support notification via a GCancellable Now nm_shutdown_wait_obj_*() supports two styles: - NM_SHUTDOWN_WAIT_TYPE_OBJECT: this just registers a weak pointer on a source GObject. As long as the object is not destroyed (and the object is not unregistered), the shutdown gets blocked. - now new is NM_SHUTDOWN_WAIT_TYPE_CANCELLABLE: this source object is a GCancellable, and during shutdown, the system will cancel the instances to notify about the shutdown. That aside, the GCancellable is tracked exactly like a regular NM_SHUTDOWN_WAIT_TYPE_OBJECT (meaning: a weak pointer is registered and shutdown gets delayed as long as the instance lives). As the rest of the shutdown, it's not yet implemented on the shutdown-side. What is now possible is to register such cancellables, so that users can make use of this API before we fix shutdown. We cannot fix it all at the same time, so first users must be ready for this approach. --- src/settings/nm-secret-agent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/settings/nm-secret-agent.c') diff --git a/src/settings/nm-secret-agent.c b/src/settings/nm-secret-agent.c index 1831d89bbb..88e6a77b6e 100644 --- a/src/settings/nm-secret-agent.c +++ b/src/settings/nm-secret-agent.c @@ -160,7 +160,7 @@ _call_id_new (NMSecretAgent *self, /* self has async requests (that keep self alive). As long as * we have pending requests, shutdown is blocked. */ priv->shutdown_wait_obj_registered = TRUE; - nm_shutdown_wait_obj_register (G_OBJECT (self), "secret-agent"); + nm_shutdown_wait_obj_register_object (G_OBJECT (self), "secret-agent"); } return call_id; -- cgit v1.2.1