Fixes memory leak in NavigationPolygon

This commit is contained in:
Haoyu Qiu 2020-02-14 10:35:09 +08:00
parent 3679d49f4b
commit 72e6369a81
2 changed files with 6 additions and 2 deletions

View file

@ -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) {

View file

@ -91,6 +91,7 @@ public:
Ref<NavigationMesh> get_mesh();
NavigationPolygon();
~NavigationPolygon();
};
class Navigation2D;