Skip to content

Commit

Permalink
[3.5+] Fix GridMap free navigation RID error spam
Browse files Browse the repository at this point in the history
Fixes GridMap free navigation RID error spam.
  • Loading branch information
smix8 committed Mar 14, 2023
1 parent 26a5841 commit befdafd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/gridmap/grid_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,10 @@ bool GridMap::_octant_update(const OctantKey &p_key) {

//erase navigation
for (Map<IndexKey, Octant::NavMesh>::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()) {
VS::get_singleton()->free(E->get().navmesh_debug_instance);
}
Expand Down

0 comments on commit befdafd

Please sign in to comment.