Fix a resource close redundancy.