Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libusb-compat-0.1 devices still referenced upon exit #25

Open
mcuee opened this issue Jan 28, 2023 · 3 comments
Open

libusb-compat-0.1 devices still referenced upon exit #25

mcuee opened this issue Jan 28, 2023 · 3 comments
Labels

Comments

@mcuee
Copy link
Member

mcuee commented Jan 28, 2023

Reference:

I am not so sure if this is an issue with libusb-compat-0.1 or libusb.

@mcuee mcuee added the bug label Jan 28, 2023
@mcuee
Copy link
Member Author

mcuee commented Oct 12, 2023

Reference:

The following fix to libusb-compat-0.1 seems to fix the issue. But I am not so sure if it is the right fix or not.

mcuee@UbuntuSwift3:~/build/libusb-compat-0.1$ git diff
diff --git a/libusb/core.c b/libusb/core.c
index 3bc9c25..09068f3 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -584,14 +584,12 @@ static int initialize_device(struct usb_device *dev)
        dev->num_children = 0;
        dev->children = NULL;
 
-       libusb_ref_device(newlib_dev);
        return 0;
 }
 
 static void free_device(struct usb_device *dev)
 {
        clear_device(dev);
-       libusb_unref_device(dev->dev);
        free(dev);
 }

@mcuee
Copy link
Member Author

mcuee commented Oct 12, 2023

Comments welcome.

@mcuee
Copy link
Member Author

mcuee commented Dec 21, 2023

@tormodvolden

Please take a look at the proposed fix. Thanks. It seems to me this is not a bug of libusb but rather libusb-compat-0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant