Implement dtors for classes, then get rid of resources (rewriting resource-using code to use classes with dtors instead).