]> sigrok.org Git - libsigrok.git/commitdiff
device: provide glib compatible callback to free usb dev inst
authorGerhard Sittig <redacted>
Sun, 30 Jan 2022 06:59:23 +0000 (07:59 +0100)
committerGerhard Sittig <redacted>
Sun, 6 Feb 2022 17:53:53 +0000 (18:53 +0100)
Provide the sr_usb_dev_inst_free_cb() routine with a compatible
signature for g_slist_free_full().

src/device.c
src/libsigrok-internal.h

index 5a450fad7ad5f186ab0facdcfd9f84db18e3c2a4..7973d1e53629e0ccba5d4bf76b1e5f1fa8e37034 100644 (file)
@@ -566,6 +566,15 @@ SR_PRIV void sr_usb_dev_inst_free(struct sr_usb_dev_inst *usb)
        g_free(usb);
 }
 
+/**
+ * Wrapper for g_slist_free_full() convenience.
+ *
+ * @private
+ */
+SR_PRIV void sr_usb_dev_inst_free_cb(gpointer p)
+{
+       sr_usb_dev_inst_free(p);
+}
 #endif
 
 #ifdef HAVE_SERIAL_COMM
index eba74e7dd016d9c1c2899959b16d7f38d855dbd1..db74dcc27e515f04b364c9425b9c5b48a5cb7f9a 100644 (file)
@@ -1688,6 +1688,7 @@ SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi);
 SR_PRIV struct sr_usb_dev_inst *sr_usb_dev_inst_new(uint8_t bus,
                uint8_t address, struct libusb_device_handle *hdl);
 SR_PRIV void sr_usb_dev_inst_free(struct sr_usb_dev_inst *usb);
+SR_PRIV void sr_usb_dev_inst_free_cb(gpointer p); /* Glib wrapper. */
 #endif
 
 #ifdef HAVE_SERIAL_COMM