Close open resource.