From 10819d872d46dc121a6c177757b11c5b8f3b59f3 Mon Sep 17 00:00:00 2001 From: TarnishedKnight Date: Tue, 4 Aug 2026 20:49:40 +0100 Subject: [PATCH 1/2] fix path cleanup when immediate path search fails (#3176) Urgent fix, which could cause memory corruption if not fixed. --- rts/Sim/Path/QTPFS/PathManager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rts/Sim/Path/QTPFS/PathManager.cpp b/rts/Sim/Path/QTPFS/PathManager.cpp index 247a277049c..b971d9c194b 100644 --- a/rts/Sim/Path/QTPFS/PathManager.cpp +++ b/rts/Sim/Path/QTPFS/PathManager.cpp @@ -1686,13 +1686,16 @@ unsigned int QTPFS::PathManager::ExecuteImmediateSearch(unsigned int pathId){ registry.remove(pathEntity); registry.remove(pathEntity); } else { - DeletePathEntity(pathEntity); pathId = 0; } } } - RemovePathSearch(pathEntity); + // If successful, just remove the path search, otherwise delete the path entity and its search. + if (pathId > 0) + RemovePathSearch(pathEntity); + else + DeletePathEntity(pathEntity); return pathId; } From 9c5dce226c3962324f0eacbb2233c3176dbf746a Mon Sep 17 00:00:00 2001 From: lostsquirrel1 Date: Tue, 4 Aug 2026 21:06:55 +0100 Subject: [PATCH 2/2] update changelog --- doc/site/content/changelogs/changelog-2026-07.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/site/content/changelogs/changelog-2026-07.markdown b/doc/site/content/changelogs/changelog-2026-07.markdown index a12976ea753..048d19ce7be 100644 --- a/doc/site/content/changelogs/changelog-2026-07.markdown +++ b/doc/site/content/changelogs/changelog-2026-07.markdown @@ -115,3 +115,4 @@ Added a bunch of `debug.emulateFoo` functions that emulate input. Useful for aut - fix Skirmish AI API compilation issues due to `AIFloat3` having a non-trivial constructor. - attempt to fix the lack of `wupget:GameProgress` calls when initially catching up. - fix Lua `VBO::CopyTo` to copy VBO data CPU side in additon to GPU side. Formerly it only copied data GPU side. +- fix QTPFS path cleanup when an immediate path search fails