# xarray.Dataset.set_close

#### Dataset.set_close(close)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/common.py#L1260-L1274)

Register the function that releases any resources linked to this object.

This method controls how xarray cleans up resources associated
with this object when the `.close()` method is called. It is mostly
intended for backend developers and it is rarely needed by regular
end-users.

* **Parameters:**
  **close** ([`callable()`](https://docs.python.org/3/builtins/functions.html#callable)) – The function that when called like `close()` releases
  any resources linked to this object.
