From c71862a8df97ec5289191708ce331949d14521ab Mon Sep 17 00:00:00 2001 From: elsid Date: Fri, 30 Dec 2022 19:26:44 +0100 Subject: [PATCH] Reset rcPolyMeshDetail members after rcFree To avoid double free causing by later recastnavigation versions. --- components/detournavigator/recast.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/detournavigator/recast.cpp b/components/detournavigator/recast.cpp index c1d14c0aa8..504de86b2d 100644 --- a/components/detournavigator/recast.cpp +++ b/components/detournavigator/recast.cpp @@ -43,8 +43,11 @@ namespace DetourNavigator void freePolyMeshDetail(rcPolyMeshDetail& value) noexcept { rcFree(value.meshes); + value.meshes = nullptr; rcFree(value.verts); + value.verts = nullptr; rcFree(value.tris); + value.tris = nullptr; } void copyPolyMesh(const rcPolyMesh& src, rcPolyMesh& dst)