-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(macOS): race conditions around WKURLSchemeTask #1484
Conversation
8f7644e
to
2139170
Compare
Package Changes Through 210a651There are 1 changes which include wry with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
2139170
to
89b2b5c
Compare
Fixes two issues which could cause race conditions when navigating between pages while custom protocol requests are in progress on macOS and iOS: - The `obc2/catch-all` feature turns all Objective-C exceptions into panics, preventing `obc2::exception::catch(...)` from working. - The `webview` and `task` objects passed to `start_task` were not retained, leading to use-after-free issues in the `responder`. - `WryWebView::remove_custom_task_key` is called from both `stop_task` and `response` which may be in different threads, so `custom_protocol_task_ids` needs to be protected by a `Mutex`. Closes tauri-apps#1189
89b2b5c
to
210a651
Compare
For us, this PR fixes the non-fatal 'unintialized instance variable' panics we've been getting. We're still getting crashes from different places but this is helpful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested:
- [bug] [macos] App is crashing when webview is reloads while async command running tauri#9933
- fix (macos) APP crash when a web custom protocol request is aborted before or during response #1214
Btw, if we can ensure task
lives through the responder, I think we could also remove check_task_is_valid
as well.
Yes, I think those checks are likely superfluous now, since the |
Fixes two issues which could cause race conditions when navigating between pages while custom protocol requests are in progress on macOS and iOS:
obc2/catch-all
feature turns all Objective-C exceptions into panics, preventingobc2::exception::catch(...)
from working.webview
andtask
objects passed tostart_task
were not retained, leading to use-after-free issues in theresponder
.WryWebView::remove_custom_task_key
is called from bothstop_task
andresponse
which may be in different threads, socustom_protocol_task_ids
needs to be protected by aMutex
.Closes #1189