summaryrefslogtreecommitdiffstats
path: root/scene/resources/2d/navigation_polygon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/2d/navigation_polygon.cpp')
-rw-r--r--scene/resources/2d/navigation_polygon.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/resources/2d/navigation_polygon.cpp b/scene/resources/2d/navigation_polygon.cpp
index a845809bf2..4a290db86b 100644
--- a/scene/resources/2d/navigation_polygon.cpp
+++ b/scene/resources/2d/navigation_polygon.cpp
@@ -193,6 +193,10 @@ void NavigationPolygon::set_data(const Vector<Vector2> &p_vertices, const Vector
for (int i = 0; i < p_polygons.size(); i++) {
polygons.write[i].indices = p_polygons[i];
}
+ {
+ MutexLock lock(navigation_mesh_generation);
+ navigation_mesh.unref();
+ }
}
void NavigationPolygon::get_data(Vector<Vector2> &r_vertices, Vector<Vector<int>> &r_polygons) {