From 6eb9ac30851f8dcc8eeaf291b3a6287e9061661d Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Tue, 14 Mar 2023 05:12:39 +0100 Subject: [PATCH] Fix GridMap free navigation RID error spam Fixes GridMap free navigation RID error spam. --- modules/gridmap/grid_map.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index a9b0d16e4..ff256eb72 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -476,7 +476,10 @@ bool GridMap::_octant_update(const OctantKey &p_key) { //erase navigation for (RBMap::Element *E = g.navmesh_ids.front(); E; E = E->next()) { - NavigationServer::get_singleton()->free(E->get().region); + if (E->get().region.is_valid()) { + NavigationServer::get_singleton()->free(E->get().region); + E->get().region = RID(); + } if (E->get().navmesh_debug_instance.is_valid()) { RS::get_singleton()->free(E->get().navmesh_debug_instance); }