release

expect fun MediaSource.release()(source)

Frees what toMediaSource minted for this source, which in a browser is the object URL.

Calling it is optional. A URL that is never released lives until the page unloads, at the cost of one blob registry entry and the handle on the picked file. Call it only once nothing reads the source any more, since an export or a probe still running on a revoked URL fails. Everywhere else this does nothing.


expect fun ImageSource.release()(source)

Frees what toImageSource minted for this source, the way MediaSource.release does.

Optional on the same terms, and safe only once nothing reads the source any more.

actual fun MediaSource.release()(source)

Does nothing.

A source built here is a path or a platform uri, neither of which holds anything open. Only a browser mints something that has to be freed.


actual fun ImageSource.release()(source)

Does nothing either, for the same reason MediaSource.release does nothing.

actual fun MediaSource.release()(source)

Revokes the object URL toMediaSource minted, which is what lets the browser drop the file behind it.

Every other arm names something this module never minted, so it is left alone.


actual fun ImageSource.release()(source)

Revokes the object URL toImageSource minted, the way MediaSource.release does.