summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2021-08-11 10:43:57 +0200
committerBenjamin Berg <benjamin@sipsolutions.net>2021-08-11 08:58:26 +0000
commite3b0d52ce504e9f0b10755bfbc329c79bd6a5519 (patch)
tree67bcaaae1c8270681bb7ffe6956aa134dffff5e4
parent70182083a1efff52ea8c0efe6efaa39480bc5a08 (diff)
device: Catch client disconnect during Release
If the client disconnected while the release call was stopping the current action, then the disconnect will be processed. This means that the device can be closed already and the session is destroyed. Add a check for this, in the same way that the vanished handler deals with this corner case.
-rw-r--r--src/device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index d505761..5b65a24 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1171,6 +1171,14 @@ fprint_device_release (FprintDBusDevice *dbus_dev,
}
session = session_data_get (priv);
+
+ /* We iterated the mainloop, the session may have disappeared already. */
+ if (!session)
+ {
+ fprint_dbus_device_complete_release (FPRINT_DBUS_DEVICE (rdev), invocation);
+ return TRUE;
+ }
+
session->invocation = g_object_ref (invocation);
priv->current_action = ACTION_CLOSE;