summaryrefslogtreecommitdiffstats
path: root/scene/3d/navigation_region_3d.cpp
diff options
context:
space:
mode:
authorSamuele Panzeri <samuele.panzeri@gmail.com>2023-04-27 18:34:30 +0200
committerSamuele Panzeri <samuele.panzeri@gmail.com>2023-04-27 20:28:22 +0200
commit4aaa2e6477c2536d55003f58a50b01a74b4af5e5 (patch)
tree7eba64423370776fa9dab607246b371217ae4f24 /scene/3d/navigation_region_3d.cpp
parent240ed28291ae87f06f7bcaa66e3d08530f210bf2 (diff)
downloadredot-engine-4aaa2e6477c2536d55003f58a50b01a74b4af5e5.tar.gz
Fix wait for thread not started
Diffstat (limited to 'scene/3d/navigation_region_3d.cpp')
-rw-r--r--scene/3d/navigation_region_3d.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/3d/navigation_region_3d.cpp b/scene/3d/navigation_region_3d.cpp
index 6af8999b89..aafc23193e 100644
--- a/scene/3d/navigation_region_3d.cpp
+++ b/scene/3d/navigation_region_3d.cpp
@@ -270,7 +270,9 @@ void NavigationRegion3D::bake_navigation_mesh(bool p_on_thread) {
void NavigationRegion3D::_bake_finished(Ref<NavigationMesh> p_nav_mesh) {
set_navigation_mesh(p_nav_mesh);
- bake_thread.wait_to_finish();
+ if (bake_thread.is_started()) {
+ bake_thread.wait_to_finish();
+ }
emit_signal(SNAME("bake_finished"));
}