From cdd5e916c5b0909d2e689266a1cfebecd3c06f90 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Jun 2026 20:08:20 +0000 Subject: [PATCH] fix(napplets): don't crash the :napplet process on memory-trim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Android instantiates the single Amethyst Application in every process, so the sandbox (`:napplet`) shares it and onCreate early-returns there, leaving the lateinit `instance` (AppModules) unset. But onTrimMemory — delivered to every process on real devices — and onTerminate called `instance` unconditionally, crashing the sandbox with UninitializedPropertyAccessException on a trim. Gate both with the cached sandbox-process check. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_016ncMHuBBVHEf7spAoSssde --- .../com/vitorpamplona/amethyst/Amethyst.kt | Bin 4505 -> 5271 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/Amethyst.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/Amethyst.kt index 5159a095922144a730a37338450a26d2870fb0d5..fb43052698c6a5cebe55a7b44417be4d677c5f5d 100644 GIT binary patch delta 701 zcmZWn&1zFY6h;?K&`sUA68XeM8>wcmt1b!(rid**u;%w^`>+@>z#JETy2 z3nAdrrEk%VPvV*T(^9;fdzpLA_d7pcUJri$*;*2OzX+M%UGqkW$de_e#bCZP>E(Dd5yHIPj-pZYF_ENxeOVeSg fqRC|`u!!h7IF}E