summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/navigation_polygon.cpp7
-rw-r--r--scene/2d/navigation_polygon.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp
index c40cdb4720..21b2bede05 100644
--- a/scene/2d/navigation_polygon.cpp
+++ b/scene/2d/navigation_polygon.cpp
@@ -363,8 +363,11 @@ void NavigationPolygon::_bind_methods() {
NavigationPolygon::NavigationPolygon() :
rect_cache_dirty(true),
- navmesh_generation(NULL) {
- navmesh_generation = Mutex::create();
+ navmesh_generation(Mutex::create()) {
+}
+
+NavigationPolygon::~NavigationPolygon() {
+ memdelete(navmesh_generation);
}
void NavigationPolygonInstance::set_enabled(bool p_enabled) {
diff --git a/scene/2d/navigation_polygon.h b/scene/2d/navigation_polygon.h
index 92cfc8f5e6..8d3d8543c4 100644
--- a/scene/2d/navigation_polygon.h
+++ b/scene/2d/navigation_polygon.h
@@ -91,6 +91,7 @@ public:
Ref<NavigationMesh> get_mesh();
NavigationPolygon();
+ ~NavigationPolygon();
};
class Navigation2D;