[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 <sahyno1996@gmail.com>
Reviewed-by: DraVee <dravee@eden-emu.dev>
Co-authored-by: xbzk <xbzk@eden-emu.dev>
Co-committed-by: xbzk <xbzk@eden-emu.dev>
This commit is contained in:
xbzk
2025-12-31 17:11:28 +01:00
committed by crueter
parent 742622a98d
commit 80327312dd

View File

@@ -1989,7 +1989,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
handler.removeCallbacksAndMessages(null)
handler.postDelayed({
if (isOverlayVisible) {
if (isOverlayVisible && isAdded && _binding != null) {
hideOverlay()
}
}, seconds * 1000L)