SRGSSR / srgmediaplayer-apple

An advanced media player library, simple and reliable
MIT License
158 stars 33 forks source link

Crashes on assertions #99

Closed defagos closed 3 years ago

defagos commented 3 years ago

A main-thread assertion check in the controller helps preventing obvious programming issues which could lead to the playback state being updated on a background thread.

Sadly, due to how the code currently behaves, it might rarely happen that deallocation triggers such changes on a background thread. Those background changes should not be too harmful in general, and we lived with them since a very long time since they are not easy to fix.

But with the recent introduction of SPM we found that assertions are not stripped from release package products written in Objective-C. I opened a dedicated thread on the Swift forums, but this means that a rare probably unharmful behavior has now turned into a rare crash.

In the thread linked above I propose a simple workaround to fix this issue, either because this is how SPM must behave by design, or while waiting for a fix in an upcoming SPM release.

defagos commented 3 years ago

For the moment we applied the workaround I proposed on the Swift forums, for all Objective-C library targets.