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

Ensure the dispatch source only gets deallocated after the dispatch_source_cancel is done, avoiding crashing of the Finder Sync Extension on macOS #4643

Merged
merged 1 commit into from
Jul 1, 2022

Conversation

claucambra
Copy link
Collaborator

Since dispatch_source_cancel works asynchronously, deallocating the dispatch source synchronously runs the risk of deallocating it before dispatch_source_cancel has completed, causing a crash.

This PR sets a completion handler that holds a strong reference to the dispatch source to be deallocated, ensuring that the dispatch source is only deallocated after the dispatch_source_cancel is done.

Close #4459

…ource_cancel is done

Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
@claucambra claucambra force-pushed the bugfix/finder-sync-crashing branch from a9b900d to a74f9b3 Compare July 1, 2022 11:15
@sonarcloud
Copy link

sonarcloud bot commented Jul 1, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@codecov
Copy link

codecov bot commented Jul 1, 2022

Codecov Report

Merging #4643 (8ce0842) into master (8ce0842) will not change coverage.
The diff coverage is n/a.

❗ Current head 8ce0842 differs from pull request most recent head a74f9b3. Consider uploading reports for the commit a74f9b3 to get more accurate results

@@           Coverage Diff           @@
##           master    #4643   +/-   ##
=======================================
  Coverage   56.41%   56.41%           
=======================================
  Files         138      138           
  Lines       17068    17068           
=======================================
  Hits         9629     9629           
  Misses       7439     7439           

@nextcloud-desktop-bot
Copy link

AppImage file: Nextcloud-PR-4643-a74f9b367d19a387cdf26d8f241ad925956ce9f1-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@claucambra claucambra merged commit 60960e7 into master Jul 1, 2022
@claucambra claucambra deleted the bugfix/finder-sync-crashing branch July 1, 2022 11:58
@mgallien
Copy link
Collaborator

mgallien commented Jul 1, 2022

/backport to stable-3.5

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.

[Bug]: macOS Nextcloud Finder extension is still crashing regularly, causing right-click menu to stop working
4 participants