diff options
author | smix8 <52464204+smix8@users.noreply.github.com> | 2023-03-14 04:07:37 +0100 |
---|---|---|
committer | smix8 <52464204+smix8@users.noreply.github.com> | 2023-03-21 12:19:36 +0100 |
commit | cc02007e30c15f3dd3bfb0e24d0f5a90b16fe5a1 (patch) | |
tree | 89f20fb851855ede2ebfb4b3165247c39f2e9c1c /modules/gridmap | |
parent | ed13a52f94601c00e1c8a967fbbdbbbf5228212f (diff) | |
download | redot-engine-cc02007e30c15f3dd3bfb0e24d0f5a90b16fe5a1.tar.gz |
Fix GridMap free navigation RID error spam
Fixes GridMap free navigation RID error spam.
Diffstat (limited to 'modules/gridmap')
-rw-r--r-- | modules/gridmap/grid_map.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 3c0bd56e86..db8c645558 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -557,10 +557,14 @@ bool GridMap::_octant_update(const OctantKey &p_key) { } //erase navigation - for (const KeyValue<IndexKey, Octant::NavigationCell> &E : g.navigation_cell_ids) { - NavigationServer3D::get_singleton()->free(E.value.region); + for (KeyValue<IndexKey, Octant::NavigationCell> &E : g.navigation_cell_ids) { + if (E.value.region.is_valid()) { + NavigationServer3D::get_singleton()->free(E.value.region); + E.value.region = RID(); + } if (E.value.navigation_mesh_debug_instance.is_valid()) { RS::get_singleton()->free(E.value.navigation_mesh_debug_instance); + E.value.navigation_mesh_debug_instance = RID(); } } g.navigation_cell_ids.clear(); |