def unload(self):
        """
        Unload all chunks and close all open filehandles.
        """
        if self.saving:
            raise ChunkAccessDenied
        self.worldFolder.closeRegions()
        if not self.readonly:
            self.unsavedWorkFolder.closeRegions()

        self._allChunks = None
        self.recentChunks.clear()
        self._loadedChunks.clear()
        self._loadedChunkData.clear()

        Unload all chunks and close all open filehandles.
        
pymclevel/infiniteworld.py