Add logic to unregister the Godot plugins on engine termination

This commit is contained in:
Fredia Huya-Kouadio 2024-05-19 15:48:30 -07:00
parent daa81bbb7d
commit 5a74e5812b
6 changed files with 38 additions and 15 deletions

View file

@ -42,6 +42,7 @@
#include "jni_utils.h"
#include "net_socket_android.h"
#include "os_android.h"
#include "plugin/godot_plugin_jni.h"
#include "string_android.h"
#include "thread_jandroid.h"
#include "tts_android.h"
@ -78,6 +79,9 @@ static void _terminate(JNIEnv *env, bool p_restart = false) {
step.set(-1); // Ensure no further steps are attempted and no further events are sent
// lets cleanup
// Unregister android plugins
unregister_plugins_singletons();
if (java_class_wrapper) {
memdelete(java_class_wrapper);
}