close

open override fun close()

Stops drawing and gives everything back.

The order is the whole point, and every step is there because leaving it out loses something: mark closed first so present stops accepting frames, close the signal so the worker's wait ends, then cancel and join the worker so a conversion already running finishes and closes its frame. Only then are the two slots drained, which is final because nothing is left running to refill them, and only then is the conversion thread closed.