android: Fix pause emulator button crashing the emulator

This commit is contained in:
kleidis 2024-09-02 02:01:02 +02:00 committed by Gamer64
parent 0d5180b60a
commit a6cc7b084d

View File

@ -307,10 +307,12 @@ void Java_io_github_mandarine3ds_mandarine_NativeLibrary_surfaceChanged(
void Java_io_github_mandarine3ds_mandarine_NativeLibrary_surfaceDestroyed(
[[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject obj) {
ANativeWindow_release(s_surf);
s_surf = nullptr;
if (window) {
window->OnSurfaceChanged(s_surf);
if (s_surf != nullptr) {
ANativeWindow_release(s_surf);
s_surf = nullptr;
if (window) {
window->OnSurfaceChanged(s_surf);
}
}
}