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

Better handle the release of resources #70

Closed
simogasp opened this issue Feb 4, 2020 · 0 comments · Fixed by #71
Closed

Better handle the release of resources #70

simogasp opened this issue Feb 4, 2020 · 0 comments · Fixed by #71
Assignees
Milestone

Comments

@simogasp
Copy link
Member

simogasp commented Feb 4, 2020

So far the release of the resources taken by the class PopSift relies on an explicit call to the uninit() method (mostly for the Pipe object contained within).
This is helpful when the object instantiated from PopSift has a broad scope and resources need to be freed explicitly without waiting for the object to go out of scope.
On the other hand, it would be nice that the object is able to automatically release the resources when it goes out of scope, i.e. the destructor is called. (Single responsibility principle)

One possibility is then to have a boolean attribute in the class, _isInit, that keeps track of the status of the object so that in the destructor the uninit method can be called if the object is still initialized.

@simogasp simogasp added this to the v1.0.0 milestone Feb 4, 2020
@simogasp simogasp self-assigned this Feb 4, 2020
@simogasp simogasp changed the title Better handle the release of resource Better handle the release of resources Feb 4, 2020
simogasp added a commit that referenced this issue Feb 4, 2020
and moving uninit in Pipe
fix #70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant