This is why, in Koka, there exists initially and finally blocks, to control resource cleanup
https://koka-lang.github.io/koka/doc/book.html#sec-resourceI think linear types and exceptions can play well together if you use controlled effects like this.