1
0
forked from drath/libratbag

ratbagd: remove devices before removing the context

This code isn't actually hit because we don't handle signals correctly, but
once we do, ratbagd_free() will assert because the devices never get removed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2017-07-28 12:47:59 +01:00
committed by Benjamin Tissoires
parent 5bcafb5bee
commit f5210e1902

View File

@@ -485,9 +485,14 @@ static const struct ratbag_interface ratbagd_lib_interface = {
static struct ratbagd *ratbagd_free(struct ratbagd *ctx)
{
struct ratbagd_device *device;
if (!ctx)
return NULL;
RATBAGD_DEVICE_FOREACH(device, ctx)
ratbagd_device_unlink(device);
ctx->bus = sd_bus_flush_close_unref(ctx->bus);
ctx->monitor_source = sd_event_source_unref(ctx->monitor_source);
ctx->monitor = udev_monitor_unref(ctx->monitor);