You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
So far the release of the resources taken by the class
PopSift
relies on an explicit call to theuninit()
method (mostly for thePipe
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.The text was updated successfully, but these errors were encountered: