File tree Expand file tree Collapse file tree
GeneralsMD/Code/GameEngine/Source/GameClient Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -786,11 +786,16 @@ void GameClient::updateHeadless()
786786 // TheSuperHackers @info helmutbuhler 03/05/2025
787787 // When we play a replay back in headless mode, we want to skip the update of GameClient
788788 // because it's not necessary for CRC checking.
789- // But we do reset the particles. The problem is that particles can be generated during
789+ // But we do update the particles. The problem is that particles can be generated during
790790 // GameLogic and are only cleaned up during rendering. If we don't clean this up here,
791791 // the particles accumulate and slow things down a lot and can even cause a crash on
792792 // longer replays.
793- TheParticleSystemManager->reset ();
793+ // TheSuperHackers @fix bobtista 02/02/2026 Use update() instead of reset() to avoid
794+ // use-after-free crash. reset() deletes all particle systems immediately, but DrawModules
795+ // (W3DTruckDraw, W3DTankDraw, etc.) hold raw pointers to particle systems. When those
796+ // DrawModules are later destroyed during game shutdown, they crash accessing freed memory.
797+ // update() only cleans up finished particle systems, leaving active ones intact.
798+ TheParticleSystemManager->update ();
794799}
795800
796801/* * -----------------------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments