summaryrefslogtreecommitdiffstats
path: root/platform
diff options
context:
space:
mode:
authorFredia Huya-Kouadio <fhuya@meta.com>2023-11-27 18:24:36 -0800
committerFredia Huya-Kouadio <fhuya@meta.com>2023-11-27 18:24:36 -0800
commit1e4af5269fd5d01188e88bd05116ffaf93ff89ad (patch)
tree1f3cb85b99976d600471d0da896db3f0960d896a /platform
parenteda44bfe109d7f15c5a965db2d65c8a17ce4b7d0 (diff)
downloadredot-engine-1e4af5269fd5d01188e88bd05116ffaf93ff89ad.tar.gz
Fix issue causing Godot Android apps / games to freeze on close
The issue occurred because during the 'close' event, the logic was trying to terminate the native engine on the UI thread instead of doing on the render thread.
Diffstat (limited to 'platform')
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/Godot.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.kt b/platform/android/java/lib/src/org/godotengine/godot/Godot.kt
index 38961bcda8..2278b46f6c 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/Godot.kt
+++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.kt
@@ -536,8 +536,11 @@ class Godot(private val context: Context) : SensorEventListener {
for (plugin in pluginRegistry.allPlugins) {
plugin.onMainDestroy()
}
- GodotLib.ondestroy()
- forceQuit()
+
+ runOnRenderThread {
+ GodotLib.ondestroy()
+ forceQuit()
+ }
}
/**