I am writing a userspace program which interacts with the USB video playback controller. I am programming in C++ and the program is intended to run on Linux. While studying the libusb manual I came across the void libusb_exit ( struct libusb_context * ctx )
function.
The description says:
Deinitialize libusb.
Should be called after closing all open devices and before your application terminates.
The manual does not explain why is it needed. I became curious about the consequences of terminating a program that had initialized and used libusb without calling libusb_exit()
. Can someone explain what bad things could happen if for some reasons my program will fail to call libusb_exit()
before terminating? Will it cause system resources to leak?