Initialize SDL before creating threads to avoid concurrency issues
Fixes #946
Thanks for the PR @berarma the pipelines are running to see if everything still builds on every system.
@ooshlablu can you repro the issue (on master) and see if this fixes it? (Debian 12) i'll do some testing with Windows later today
Download the artifacts for this pull request:
- Performous-1.3.0-951-d3e006e-alpha.AppImage.zip
- Performous-1.3.0-951-d3e006e-alpha.dmg.zip
- Performous-1.3.0-951-d3e006e-alpha-debian_10.deb.zip
- Performous-1.3.0-951-d3e006e-alpha-debian_11.deb.zip
- Performous-1.3.0-951-d3e006e-alpha-debian_12.deb.zip
- Performous-1.3.0-951-d3e006e-alpha-fedora_35.rpm.zip
- Performous-1.3.0-951-d3e006e-alpha-fedora_36.rpm.zip
- Performous-1.3.0-951-d3e006e-alpha-fedora_37.rpm.zip
- Performous-1.3.0-951-d3e006e-alpha-fedora_38.rpm.zip
- Performous-1.3.0-951-d3e006e-alpha-fedora_39.rpm.zip
- Performous-1.3.0-951-d3e006e-alpha-mingw-w64.exe.zip
- Performous-1.3.0-951-d3e006e-alpha-msvc.exe.zip
- Performous-1.3.0-951-d3e006e-alpha-ubuntu_20.04.deb.zip
- Performous-1.3.0-951-d3e006e-alpha-ubuntu_22.04.deb.zip
This service is provided by nightly.link. These artifacts will expire in 90 days and will not be available for download after that time.
I've changed the PR since I've found we can still load the cache file asynchronously if we init SDL before loading it.
Was this issue platform-specific? I think it's weird that I never encountered it.
That aside, I think we should really update the nlohmann syntax on the cache code, I've been saying this for a while.
There's an .at method that has bounds-checking and would allow us better catching of exceptions. It was introduced I think in nlohmann 3.6 or something of the like. Way back when there waa pushback on this because of compatibility with distro packages, but I doubt that's an issue anymore?
@ooshlablu can you please test this one. If is it ok I will merge it.
Was this issue platform-specific?
Most probably. It's due to SDL changing the locale temporarily for calling a X11 function as reported in the related issue.
Thanks for the PR, going to merge it :)