diff options
author | Dominik 'dreamsComeTrue' Jasiński <dominikjasinski@o2.pl> | 2020-02-25 23:43:59 +0100 |
---|---|---|
committer | Dominik 'dreamsComeTrue' Jasiński <dominikjasinski@o2.pl> | 2020-02-25 23:43:59 +0100 |
commit | 51cbf414fc133ba3d5e7156effb13c5384c92ebb (patch) | |
tree | f87d17163b5f40358b1d9f1c8d38839a18c14b85 /scene | |
parent | 2d980f6f13cc761c1eb9329e7eaeba5e9d1a9b37 (diff) |
Added missing destructor for Navigation2D
Although destructor call was missing, it still doesn't heal #36537 memory leaks. Further description how that might be overcome - on GitHub
Partialy covers #36537
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/navigation_2d.cpp | 4 | ||||
-rw-r--r-- | scene/2d/navigation_2d.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/scene/2d/navigation_2d.cpp b/scene/2d/navigation_2d.cpp index e91560a7e0..bbabfa16c7 100644 --- a/scene/2d/navigation_2d.cpp +++ b/scene/2d/navigation_2d.cpp @@ -88,3 +88,7 @@ Navigation2D::Navigation2D() { set_cell_size(10); // Ten pixels set_edge_connection_margin(100); } + +Navigation2D::~Navigation2D() { + Navigation2DServer::get_singleton()->free(map); +} diff --git a/scene/2d/navigation_2d.h b/scene/2d/navigation_2d.h index 16e20d8f9b..5520f5006e 100644 --- a/scene/2d/navigation_2d.h +++ b/scene/2d/navigation_2d.h @@ -66,6 +66,7 @@ public: RID get_closest_point_owner(const Vector2 &p_point) const; Navigation2D(); + ~Navigation2D(); }; #endif // NAVIGATION_2D_H |