Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ wrapper, only call teardown in destructors if context exists #130

Merged
merged 2 commits into from
Sep 3, 2023

Conversation

niklasva
Copy link
Contributor

@niklasva niklasva commented Sep 1, 2023

Fixes #129.

Adds a check to the destructors of OSDP::ControlPanel and OSDP::Peripheral to see if the context has been set during the object's lifetime. This decides whether a teardown should happen or not. An uninitialized object would otherwise fail when being destroyed.

Copy link
Member

@sidcha sidcha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@sidcha sidcha merged commit 3c762ea into goToMain:master Sep 3, 2023
9 checks passed
@niklasva niklasva deleted the cpp_teardown_ctx branch September 4, 2023 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ControlPanel destructor gives teardown error when not initiated
2 participants