>One need to write it manually each time in each function where some cleanup is needed.
You can structure your code to not need cleanup in every function.
The biggest problem with destructors is, how do you handle errors? close() can fail you know?
Usually destructors can't fail. But for rare cases like with close() you can write a helper function (static method) which destroys the given object and returns an error if has one.
Usually destructors can't fail. But for rare cases like with close() you can write a helper function (static method) which destroys the given object and returns an error if has one.