Skip to content

Fix accessing deleted memory in OpenJO g_navigator.cpp - #1347

Open
jncronin wants to merge 1 commit into
JACoders:masterfrom
jncronin:fix-g_navigator-null-ref
Open

Fix accessing deleted memory in OpenJO g_navigator.cpp#1347
jncronin wants to merge 1 commit into
JACoders:masterfrom
jncronin:fix-g_navigator-null-ref

Conversation

@jncronin

Copy link
Copy Markdown

Have CNavigator::Free() in codeJK2 call m_nodes.clear() and m_edgeLookupMap.clear(). This fixes a bug on single player level end where the CNode * pointers were being deleted in Free() but not removed from m_nodes, so the next iteration of m_nodes would access deleted memory. This also aligns codeJK2/g_navigator.cpp with codemp/navigator.cpp.

…kupMap.clear(). This fixes a bug on single player level end where the CNode * pointers were being deleted but not removed from m_nodes, so the next iteration of m_nodes would access deleted memory. This also aligns codeJK2/g_navigator.cpp with codemp/navigator.cpp.
@jncronin
jncronin requested a review from a team as a code owner July 29, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant