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.
This commit is contained in:
Benjamin Berg
2021-08-11 10:43:57 +02:00
committed by Benjamin Berg
parent 70182083a1
commit e3b0d52ce5

View File

@ -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;