Closed kdrag0n closed 1 year ago
Thank you for your patch!
Mhm, I wonder why changing unowned to weak fixes this?
I think it's because unowned
is strict and crashes if you try to access a reference to a freed object. weak
returns nil
instead, which is more in line with the expected behavior for delegates.
unowned
should be banned for 99% of cases, it is dangerous as we do not have, most of time, control to ARC overtime so the pointer should be set to nil when release (weak
) instead of keep it (unowned
)
If a LocalProcess is terminated or exits right before the hosting LocalProcessTerminalView is released, the processTerminated call crashes the app with the following error:
All usages of delegate already have nil checks, so just change the variable from unowned to weak to fix the issue. There's no point in calling the delegate when it no longer exists.