diff options
author | Benjamin Berg <bberg@redhat.com> | 2021-08-11 10:43:57 +0200 |
---|---|---|
committer | Benjamin Berg <benjamin@sipsolutions.net> | 2021-08-11 08:58:26 +0000 |
commit | e3b0d52ce504e9f0b10755bfbc329c79bd6a5519 (patch) | |
tree | 67bcaaae1c8270681bb7ffe6956aa134dffff5e4 | |
parent | 70182083a1efff52ea8c0efe6efaa39480bc5a08 (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.c | 8 |
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; |