1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 03:29:55 +00:00

Reset rcPolyMeshDetail members after rcFree

To avoid double free causing by later recastnavigation versions.
This commit is contained in:
elsid 2022-12-30 19:26:44 +01:00
parent d5f5e53714
commit c71862a8df
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625

View file

@ -43,8 +43,11 @@ namespace DetourNavigator
void freePolyMeshDetail(rcPolyMeshDetail& value) noexcept void freePolyMeshDetail(rcPolyMeshDetail& value) noexcept
{ {
rcFree(value.meshes); rcFree(value.meshes);
value.meshes = nullptr;
rcFree(value.verts); rcFree(value.verts);
value.verts = nullptr;
rcFree(value.tris); rcFree(value.tris);
value.tris = nullptr;
} }
void copyPolyMesh(const rcPolyMesh& src, rcPolyMesh& dst) void copyPolyMesh(const rcPolyMesh& src, rcPolyMesh& dst)