Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(macos): prevent task object been released while executing async command #1285

Merged
merged 4 commits into from
Jun 11, 2024

Conversation

pewsheen
Copy link
Contributor

@pewsheen pewsheen commented Jun 4, 2024

Ref: tauri-apps/tauri#9933 #1142 #1189 #1214

  • Retain the task until the response closure ends, and catch exceptions from the task function call.

In async mode, task object may become invalid and be dropped at any moment while executing the responder. By retaining the task, we can be sure the pointer will not point to a released object. If the task is marked as invalid, it will throw an exception, and we'll catch it, return the closure, and release the task object.

Tested with #1214, tauri-apps/tauri#9933

@pewsheen pewsheen requested a review from a team as a code owner June 4, 2024 09:36
@pewsheen pewsheen requested review from FabianLars and removed request for a team June 4, 2024 09:36
@wusyong wusyong merged commit 8b691df into dev Jun 11, 2024
12 checks passed
@wusyong wusyong deleted the fix/macos-mitigate-async-crash branch June 11, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants