Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Fix GridMap octant debug not freeing mesh

smix8c295534e11ec
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 95e1c362e9a..a2738c0f6d7 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -2105,6 +2105,11 @@ GridMap::~GridMap() {
#ifdef DEBUG_ENABLED
_debug_clear_octants();
+ if (debug_octant_line_mesh_rid.is_valid()) {
+ RS::get_singleton()->free_rid(debug_octant_line_mesh_rid);
+ debug_octant_line_mesh_rid = RID();
+ }
+
#ifndef NAVIGATION_3D_DISABLED
NavigationServer3D::get_singleton()->disconnect("map_changed", callable_mp(this, &GridMap::_navigation_map_changed));
NavigationServer3D::get_singleton()->disconnect("navigation_debug_changed", callable_mp(this, &GridMap::_update_navigation_debug_edge_connections));