-
Notifications
You must be signed in to change notification settings - Fork 32
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
Dealloc in background - updateTracksForPlayer: not call on main thread #120
Comments
Thanks to @defagos , we can reproduce the issue easy with Letterbox Demo and the "feeds" view. We confirmed that an |
SRGMediaPlayer contrat is to publish notifications on the main thread. Playback state, subtitles change, audio selection are usually matched for the UI. Isolate But in So we should call On |
I don't know whether the trick you propose is safe or not, without further investigations I really cannot say. What I am quite certain of, though, is that we should avoid this kind of trick at deallocation time for the sake of eliminating an assertion, except if you are totally confident this is a safe. If not then I would rather remove the assertion and do better in the future. We know we don't have any major issue with the current code in production (the assertion is stripped out from release builds after all), but I don't know what might happen if we release this kind of fix without being sure it will not be a problem when deployed to hundreds of thousands devices. |
When running the UTs a deadlock might sometimes occur. I suspect this is related to the use of |
Assertions were simply removed in the end. |
Issue type
Incorrect behavior
Description of the problem
Some logs in our CI during tests reported an assertion:
[SRGMediaPlayerController updateTracksForPlayer:] not call on main thread
.On our CI, we saw in logs that on Letterbox-Apple CI, it's due to a MAKVONotificationCenter deallocation from a background thread.
It's an assertion from
updateTracksForPlayer:
method onSRGMediaController
.Environment information
Reproducibility
Update: Always reproducible
Was Difficult to reproduce
eps to reproduce
Dealloc a controller in a background thread.
The text was updated successfully, but these errors were encountered: