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.
This commit is contained in:
Fredia Huya-Kouadio 2023-11-27 18:24:36 -08:00
parent eda44bfe10
commit 1e4af5269f

View file

@ -536,9 +536,12 @@ class Godot(private val context: Context) : SensorEventListener {
for (plugin in pluginRegistry.allPlugins) { for (plugin in pluginRegistry.allPlugins) {
plugin.onMainDestroy() plugin.onMainDestroy()
} }
runOnRenderThread {
GodotLib.ondestroy() GodotLib.ondestroy()
forceQuit() forceQuit()
} }
}
/** /**
* Activity result callback * Activity result callback