This should be done in ``close()`` instead of ``__destruct()``