Fix use of references to buffers after calling dav1d_close()
Fixes #353 (closed).
I initially thought to just wrap Dav1dMemPool
inside Dav1dRef
, but that would have the downside of keeping all buffers in the pool allocated after the decoder has been closed until all references has been released which wouldn't be ideal for the use case mentioned in #353 (comment 74989).
This approach de-allocates buffers as soon as possible after the decoder has been closed.
Edited by Henrik Gramner