-
Notifications
You must be signed in to change notification settings - Fork 6
Inverted destroy logic? #27
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues.
- This issue is not a question, feature request, or anything other than a bug report directly related to this project.
Description
While building some Rust bindings I stumbled on this one... it looks like the logic is inverted here:
zed-c-api/src/ZEDController.hpp
Lines 59 to 64 in a684088
| static void destroyInstance(int i) { | |
| if (!instance[i]) // Only allow one instance of class to be generated. | |
| delete instance[i]; | |
| instance[i] = nullptr; | |
| } |
!nullptr -> true -> delete nullptr -> coredump
Steps to Reproduce
...
Expected Result
should only remove instances that exists
Actual Result
delete nullptr
ZED Camera model
ZED2i
Environment
should not matterAnything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working