I've updated previous proposal for isolated synchronous deinit, and would like to pitch it again.
The main updates are:
- Isolation for synchronous deinit now is an opt-in using the
- Copying task-locals can be disabled for performance using new
@resetTaskLocals attribute, but by default task-locals are copied.
- Support for asynchronous
deinit was added. Asynchronous deinit always executes concurrently with the code that triggered last release.
Please share any thoughts, questions or suggestions!
Thanks. I’m missing this in some cases, so very welcome from me.
+1, especially for the 'isolated deinit'. For me it's closing a gap for classes derived from
UIViewController as outlined in the proposal.
Do I understand the proposal correctly that synchronous deinit defaults to non-isolated, but asynchronous deinit defaults to isolated?
Of course, if async deinit is inside a class without isolation, then it also will be nonisolated.
As mentioned in the proposal the main reason is to discourage people from awaiting on individual properties.