Commit e437d201 authored by Bastien Nocera's avatar Bastien Nocera

device: Don't call fp_async_dev_close() with NULL device

In some cases, the priv->dev is already freed and NULL, so ensure
that we don't try to close NULL devices and crash.
parent fa31b0ae
......@@ -556,9 +556,11 @@ _fprint_device_client_vanished (GDBusConnection *connection,
done = FALSE;
/* Close the claimed device as well */
if (priv->dev) {
fp_async_dev_close (priv->dev, action_stop_cb, &done);
while (done == FALSE)
g_main_context_iteration (NULL, TRUE);
}
g_free (priv->sender);
priv->sender = NULL;
......@@ -728,6 +730,7 @@ static void fprint_device_release(FprintDevice *rdev,
}
session->context_release_device = context;
if (priv->dev)
fp_async_dev_close(priv->dev, dev_close_cb, rdev);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment