From 80327312dd981c8ec94588402dfe6ae410d679a5 Mon Sep 17 00:00:00 2001 From: xbzk Date: Wed, 31 Dec 2025 17:11:28 +0100 Subject: [PATCH] [android] added barrier for joypad overlay autohide after emulationfragment is destroyed (#3243) This PR fixes the real culprit for the crash mentioned in #3212 (which has its value coz it fixes other layout's minor navigation issues) The reason was not the carousel, but the joypad overlay autohide instead. To reproduce the crash, just enable autohide, launch the game, and leave before overlay gets hidden. eden should crash in few seconds. The fix was adding barriers to ensure fragment is currently attached to its activity and the binding is not null. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3243 Reviewed-by: Maufeat Reviewed-by: DraVee Co-authored-by: xbzk Co-committed-by: xbzk --- .../main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt index 05134cffb1..d92ca12e6d 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt @@ -1989,7 +1989,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { handler.removeCallbacksAndMessages(null) handler.postDelayed({ - if (isOverlayVisible) { + if (isOverlayVisible && isAdded && _binding != null) { hideOverlay() } }, seconds * 1000L)