diff options
author | mashumafi <mashumafi@gmail.com> | 2023-04-12 17:58:30 -0400 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2023-05-12 12:07:01 +0200 |
commit | 0cb1fd3a612ea9991f9821e865517877314e9632 (patch) | |
tree | 87b99dc860f578892a6b7439d6ebb9404b040367 | |
parent | d56c4f960cb5f386ba3561bbf3cf7ff98c7a6d9e (diff) |
Wait for navigation baking to finish before destruction
(cherry picked from commit a93a2e519d8f6e2fd206501f05b0b01097f74e1b)
-rw-r--r-- | scene/3d/navigation_region_3d.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/3d/navigation_region_3d.cpp b/scene/3d/navigation_region_3d.cpp index 22a6ec3517..f925c5020a 100644 --- a/scene/3d/navigation_region_3d.cpp +++ b/scene/3d/navigation_region_3d.cpp @@ -372,6 +372,10 @@ NavigationRegion3D::NavigationRegion3D() { } NavigationRegion3D::~NavigationRegion3D() { + if (bake_thread.is_started()) { + bake_thread.wait_to_finish(); + } + if (navigation_mesh.is_valid()) { navigation_mesh->disconnect("changed", callable_mp(this, &NavigationRegion3D::_navigation_changed)); } |