Does this ensure the resource is closed?