CCyUSBDevice::~CCyUSBDevice calls Close without checking IsOpen | Cypress Semiconductor
CCyUSBDevice::~CCyUSBDevice calls Close without checking IsOpen
CCyUSBDevice::Close destroys the device state and should not be called twice. IsOpen function call in the destructor should prevent calling Close again.
The problem appears when the device is a local variable on the stack in a function. In such case the device destructor is called at the end of the function, but function Close can be called in the middle of the function for some reason.