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 leaked background tasks #340

Merged
merged 3 commits into from
Apr 21, 2022
Merged

Fix leaked background tasks #340

merged 3 commits into from
Apr 21, 2022

Conversation

vayesh
Copy link
Contributor

@vayesh vayesh commented Apr 21, 2022

Fixes #336.

The problem was caused when the app goes to background with zero events in the eventQueue. In that case we start the bg task, but do not end end it.

The PR:

  • adds a check to flush method,
  • makes taskIdentifier thread-safe
  • moves initialization of bg task to from UIApplicationDidEnterBackgroundNotification notification to flush method, so a task will be spawned on each attempt to send events.

@vayesh vayesh merged commit 971ad20 into main Apr 21, 2022
@vayesh vayesh deleted the vesh93/bgtask_crash_fix branch April 21, 2022 11:59
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.

🐞 [iOS] app is killed with signal 9 when put in background
2 participants