From 0cb1fd3a612ea9991f9821e865517877314e9632 Mon Sep 17 00:00:00 2001 From: mashumafi Date: Wed, 12 Apr 2023 17:58:30 -0400 Subject: Wait for navigation baking to finish before destruction (cherry picked from commit a93a2e519d8f6e2fd206501f05b0b01097f74e1b) --- scene/3d/navigation_region_3d.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scene') 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)); } -- cgit v1.2.3