From 906aff53311f885b268d9a76b1bb49e6c99a0ff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Sat, 13 Sep 2025 11:22:40 +0300 Subject: [PATCH] Fix iOS/visionOS export plugin crash on exit. --- editor/export/editor_export_platform_apple_embedded.cpp | 6 ------ editor/export/editor_export_platform_apple_embedded.h | 7 +++++++ platform/ios/export/export_plugin.cpp | 3 +++ platform/visionos/export/export_plugin.cpp | 3 +++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/editor/export/editor_export_platform_apple_embedded.cpp b/editor/export/editor_export_platform_apple_embedded.cpp index 35ec6244513..02c7f933440 100644 --- a/editor/export/editor_export_platform_apple_embedded.cpp +++ b/editor/export/editor_export_platform_apple_embedded.cpp @@ -2893,10 +2893,4 @@ EditorExportPlatformAppleEmbedded::EditorExportPlatformAppleEmbedded(const char } EditorExportPlatformAppleEmbedded::~EditorExportPlatformAppleEmbedded() { -#ifdef MACOS_ENABLED - quit_request.set(); - if (check_for_changes_thread.is_started()) { - check_for_changes_thread.wait_to_finish(); - } -#endif } diff --git a/editor/export/editor_export_platform_apple_embedded.h b/editor/export/editor_export_platform_apple_embedded.h index faea163e107..691404920c5 100644 --- a/editor/export/editor_export_platform_apple_embedded.h +++ b/editor/export/editor_export_platform_apple_embedded.h @@ -98,6 +98,13 @@ protected: check_for_changes_thread.start(_check_for_changes_poll_thread, this); } + void _stop_remote_device_poller_thread() { + quit_request.set(); + if (check_for_changes_thread.is_started()) { + check_for_changes_thread.wait_to_finish(); + } + } + int _execute(const String &p_path, const List &p_arguments, std::function p_on_data); private: diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp index 1f40fe27dd7..eadf9a8279a 100644 --- a/platform/ios/export/export_plugin.cpp +++ b/platform/ios/export/export_plugin.cpp @@ -43,6 +43,9 @@ EditorExportPlatformIOS::EditorExportPlatformIOS() : } EditorExportPlatformIOS::~EditorExportPlatformIOS() { +#ifdef MACOS_ENABLED + _stop_remote_device_poller_thread(); +#endif } void EditorExportPlatformIOS::get_export_options(List *r_options) const { diff --git a/platform/visionos/export/export_plugin.cpp b/platform/visionos/export/export_plugin.cpp index 5f188a3fdb7..8f631281375 100644 --- a/platform/visionos/export/export_plugin.cpp +++ b/platform/visionos/export/export_plugin.cpp @@ -43,6 +43,9 @@ EditorExportPlatformVisionOS::EditorExportPlatformVisionOS() : } EditorExportPlatformVisionOS::~EditorExportPlatformVisionOS() { +#ifdef MACOS_ENABLED + _stop_remote_device_poller_thread(); +#endif } void EditorExportPlatformVisionOS::get_export_options(List *r_options) const {