diff options
author | Richard Hughes <richard@hughsie.com> | 2022-10-17 10:42:56 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2022-10-17 10:43:04 +0100 |
commit | 440423dcdcfb4e7d290b5e8993e67b0070e1a314 (patch) | |
tree | 914e5935b392ff37d3f8d891c22aee3e5b638fd0 | |
parent | cfb40102b0985d52cbd5d9348dedd1a4cc06b10c (diff) | |
download | gusb-440423dcdcfb4e7d290b5e8993e67b0070e1a314.tar.gz |
Close the GUsbDevice objects in gusbcmd
-rw-r--r-- | tools/gusb-main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/gusb-main.c b/tools/gusb-main.c index 1f0826d..8037310 100644 --- a/tools/gusb-main.c +++ b/tools/gusb-main.c @@ -146,6 +146,10 @@ gusb_main_device_open(GUsbDevice *device) } g_print("product: %s\n", product); } + if (!g_usb_device_close(device, &error)) { + g_print("failed to close: %s\n", error->message); + return; + } } static void @@ -246,6 +250,7 @@ gusb_cmd_show_cb(GNode *node, gpointer data) g_string_append_printf(str, "%s - %s", vendor, product); g_print("%s\n", str->str); + g_usb_device_close(device, NULL); return FALSE; } |