CCyUSBDevice::~CCyUSBDevice calls Close without checking IsOpen

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 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.

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The Cypress toolchain does not (yet) support C++. The GCC does not have got destructors, so the error you discovered seems to have been induced by switching form C to C++

   

 

   

Bob

0 Likes
Anonymous
Not applicable

You are right. The conversion from C to C++ was done by Cypress team.

0 Likes
Anonymous
Not applicable

Thank you for quick reply. How can I get support for this issue?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

How was the contact made to have Cypress do the conversion? Is there someone you can contact?? A name in the source??

   

If that channel doesn't work, file a "MyCase" (At top of this page; Support & Community -> Technical Support -> Create a MyCase)

   

 

   

Bob

0 Likes