Skip to content

Inverted destroy logic? #27

@gbin

Description

@gbin

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:

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 matter

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions