| 399 | } |
| 400 | |
| 401 | ~Freenect2Impl() |
| 402 | { |
| 403 | if (!initialized) |
| 404 | return; |
| 405 | |
| 406 | clearDevices(); |
| 407 | clearDeviceEnumeration(); |
| 408 | |
| 409 | usb_event_loop_.stop(); |
| 410 | |
| 411 | if(managed_usb_context_ && usb_context_ != 0) |
| 412 | { |
| 413 | libusb_exit(usb_context_); |
| 414 | usb_context_ = 0; |
| 415 | } |
| 416 | } |
| 417 | |
| 418 | void addDevice(Freenect2DeviceImpl *device) |
| 419 | { |