Pad/cmd/pad
Greg Pomerantz fdbffc9f5c Fix SIGABRT on activity destroy: null view in registerFragment
Crash on device (Pixel 9 Pro, Android 17) when swiping the app away
from recents:

  JNI DETECTED ERROR: java_object == null in call to GetObjectClass
  #06 libgio.so (registerFragment+104)

Root cause: Gio's window.detach sends an EMPTY AndroidViewEvent
(View == 0) as its detach signal (os_android.go: window.detach ->
processEvent(AndroidViewEvent{})), which fires when the GioView is
destroyed — i.e. the activity going away on a recents-wipe. Our
handleEvent passed that null ref straight into registerFragment,
whose GetObjectClass(null) aborts. Pre-existing latent bug; the
emulator never delivered a detach event in testing (home keeps the
view attached, force-stop kills before the event dispatches).

Guard on both sides: handleEvent ignores the View == 0 detach
signal (a re-attach arrives as a fresh event with a live view), and
registerFragment returns early on a null view as defense in depth.

Verified on the crashing device: recents swipe now closes the app
cleanly, crash buffer empty.
2026-08-20 18:49:00 -04:00
..
impl_android.go Fix SIGABRT on activity destroy: null view in registerFragment 2026-08-20 18:49:00 -04:00
impl_other.go Flush the session snapshot on activity onStop (Android) 2026-08-20 18:24:43 -04:00
jni_android.c Fix SIGABRT on activity destroy: null view in registerFragment 2026-08-20 18:49:00 -04:00
jni_android.h Fix selection-handle drags, menu anchoring, and left-edge back-gesture theft 2026-08-18 13:09:29 -04:00
main.go Flush the session snapshot on activity onStop (Android) 2026-08-20 18:24:43 -04:00
Permissions.java Refactor RealFileSystem to use WorkingDir, and ensure clean shutdown with FlushAll 2026-06-05 11:42:39 -04:00