Skip to content

Commit 906aff5

Browse files
committed
Fix iOS/visionOS export plugin crash on exit.
1 parent 9edc290 commit 906aff5

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

editor/export/editor_export_platform_apple_embedded.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2893,10 +2893,4 @@ EditorExportPlatformAppleEmbedded::EditorExportPlatformAppleEmbedded(const char
28932893
}
28942894

28952895
EditorExportPlatformAppleEmbedded::~EditorExportPlatformAppleEmbedded() {
2896-
#ifdef MACOS_ENABLED
2897-
quit_request.set();
2898-
if (check_for_changes_thread.is_started()) {
2899-
check_for_changes_thread.wait_to_finish();
2900-
}
2901-
#endif
29022896
}

editor/export/editor_export_platform_apple_embedded.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ class EditorExportPlatformAppleEmbedded : public EditorExportPlatform {
9898
check_for_changes_thread.start(_check_for_changes_poll_thread, this);
9999
}
100100

101+
void _stop_remote_device_poller_thread() {
102+
quit_request.set();
103+
if (check_for_changes_thread.is_started()) {
104+
check_for_changes_thread.wait_to_finish();
105+
}
106+
}
107+
101108
int _execute(const String &p_path, const List<String> &p_arguments, std::function<void(const String &)> p_on_data);
102109

103110
private:

platform/ios/export/export_plugin.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ EditorExportPlatformIOS::EditorExportPlatformIOS() :
4343
}
4444

4545
EditorExportPlatformIOS::~EditorExportPlatformIOS() {
46+
#ifdef MACOS_ENABLED
47+
_stop_remote_device_poller_thread();
48+
#endif
4649
}
4750

4851
void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options) const {

platform/visionos/export/export_plugin.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ EditorExportPlatformVisionOS::EditorExportPlatformVisionOS() :
4343
}
4444

4545
EditorExportPlatformVisionOS::~EditorExportPlatformVisionOS() {
46+
#ifdef MACOS_ENABLED
47+
_stop_remote_device_poller_thread();
48+
#endif
4649
}
4750

4851
void EditorExportPlatformVisionOS::get_export_options(List<ExportOption> *r_options) const {

0 commit comments

Comments
 (0)