Is it so much trouble for you to do this manually? You simply need to keep track of the resources. I recommend to make a list of resources on a piece of paper while coding as a reminder. Then, when you do a code review you can look at your checklist to see if you haven't forgotten anything.
Also, this manual resource managment is very flexible and puts you in control. It just requires some more effort and responsibility on the programmers side of things. If everything was automatic in life, it would be very boring. If you drive a car, you need to move the gear lever yourself, unless you want to drive in a boring automatic with no precise control. A manual car makes you feel more connected to the machinery, and an automatic feels very detached. Same thing applies for programming.