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

hardware usb connection isn't properly closed #20

Open
wouterverweirder opened this issue Oct 15, 2012 · 0 comments
Open

hardware usb connection isn't properly closed #20

wouterverweirder opened this issue Oct 15, 2012 · 0 comments

Comments

@wouterverweirder
Copy link

I noticed an issue with the hardware shutdown code. The claimed usb device isn't properly released, which causes issues when you create a new instance of the hardware layer without shutting down. Fix would be:

  • initialize the dev pointer to zero in the constructor.

  • adjust the shutdown code to contain the following:

    if(dev != 0)
    {
    libusb_close(dev);
    libusb_release_interface(dev, 0);
    }
    libusb_exit(ctx);

this closes & releases the dev handle properly

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

No branches or pull requests

1 participant