virtual-device: Handle cancelled state gracefully in should_wait_to_sleep

This commit is contained in:
Marco Trevisan (Treviño) 2021-01-28 11:32:46 +01:00
parent acd0a10e76
commit 74f8a8ee27

View file

@ -469,7 +469,11 @@ should_wait_to_sleep (FpDeviceVirtualDevice *self,
if (g_str_has_prefix (cmd, SLEEP_CMD_PREFIX)) if (g_str_has_prefix (cmd, SLEEP_CMD_PREFIX))
{ {
g_free (process_cmds (self, FALSE, NULL)); g_autoptr(GError) local_error = NULL;
g_free (process_cmds (self, FALSE, &local_error));
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
return FALSE;
g_assert (!self->injected_synthetic_cmd); g_assert (!self->injected_synthetic_cmd);
g_assert (self->sleep_timeout_id != 0); g_assert (self->sleep_timeout_id != 0);