From bb5a7cbd1f9ca640f14f5bf442af09c365090ba3 Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Sun, 13 Sep 2015 23:10:34 +0200 Subject: [PATCH] hidpp10: drop internal ref counts This caused a problem since the hidpp10_device would keep a ref to the ratbag_device - and the hidpp10_device would only get destroyed when the ratbag_device got a ref count 0. --- src/hidpp10.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hidpp10.c b/src/hidpp10.c index c3cacd7c..3f4a9eeb 100644 --- a/src/hidpp10.c +++ b/src/hidpp10.c @@ -945,7 +945,7 @@ hidpp10_device_new(struct ratbag_device *device, int index) return NULL; dev->index = index; - dev->ratbag_device = ratbag_device_ref(device); + dev->ratbag_device = device; return dev; } @@ -991,6 +991,5 @@ hidpp10_device_new_from_idx(struct ratbag_device *device, int idx) void hidpp10_device_destroy(struct hidpp10_device *dev) { - ratbag_device_unref(dev->ratbag_device); free(dev); }