mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-09 23:00:20 +02:00
Fixes an issue where a thread that exits with the `exit` syscall never actually frees its pivot stack. This is common practice and it was missed when I was fixing the previous stack pivot leak. This was uncovered when looking at the game [RUINER](https://store.steampowered.com/agecheck/app/464060/?curator_clanid=4777282) for timing bugs. Turns out the Linux build of the game creates and destroys a VLC object every tick of the engine. Creating this VLC object creates six threads behind the scenes. At what I assume the default tick of the engine is of 120Hz(?) this would mean it is attempting to create and destroy 720 threads per second, quickly leading to memory exhaustion under FEX. While this hits the biggest memory leak we have around thread creation, this game is still hitting thread creation so hard that I can see other leaks that I need to track down still.