f2e-spec icon indicating copy to clipboard operation
f2e-spec copied to clipboard

Initialize SDL before creating threads to avoid concurrency issues

Open berarma opened this issue 2 years ago • 3 comments

Fixes #946

berarma avatar Nov 27 '23 00:11 berarma

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

Baklap4 avatar Nov 27 '23 07:11 Baklap4

I've changed the PR since I've found we can still load the cache file asynchronously if we init SDL before loading it.

berarma avatar Dec 02 '23 00:12 berarma

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?

Lord-Kamina avatar Mar 28 '24 07:03 Lord-Kamina

@ooshlablu can you please test this one. If is it ok I will merge it.

twollgam avatar Mar 28 '24 07:03 twollgam

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.

berarma avatar Mar 28 '24 09:03 berarma

Thanks for the PR, going to merge it :)

Baklap4 avatar Mar 29 '24 11:03 Baklap4