Selaa lähdekoodia

Merge pull request #94923 from m4gr3d/fix_crash_on_android_terminate

Fix crash that occurs on termination of the Godot engine on Android
Rémi Verschelde 1 vuosi sitten
vanhempi
commit
862d881843
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. 4 0
      platform/android/java_godot_lib_jni.cpp

+ 4 - 0
platform/android/java_godot_lib_jni.cpp

@@ -83,6 +83,10 @@ static Vector3 magnetometer;
 static Vector3 gyroscope;
 static Vector3 gyroscope;
 
 
 static void _terminate(JNIEnv *env, bool p_restart = false) {
 static void _terminate(JNIEnv *env, bool p_restart = false) {
+	if (step.get() == STEP_TERMINATED) {
+		return;
+	}
+
 	step.set(STEP_TERMINATED); // Ensure no further steps are attempted and no further events are sent
 	step.set(STEP_TERMINATED); // Ensure no further steps are attempted and no further events are sent
 
 
 	// lets cleanup
 	// lets cleanup