ofxOpenNI
ofxOpenNI copied to clipboard
hardware usb connection isn't properly closed
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