fix(keyboard): close librime on every hide to avoid 0xdead10cc kills

Hiding the keyboard on the typing surface kept librime's LevelDB userdb
LOCK open in the App Group, so RunningBoard killed the suspended extension.
Finalize the runtime on every hide (and when schema selection fails);
viewWillAppear re-prepares Rime in about 30-50 ms.
This commit is contained in:
2026-10-20 20:20:07 +02:00
parent f463f78296
commit fd07c6e39e
3 changed files with 9 additions and 4 deletions
+3 -1
View File
@@ -47,7 +47,9 @@ public final class LibrimeEngine: RimeEngineBridging {
let configured = configurationProvider()
schema = configured.schema
guard runtime.selectSchema(schema.rawValue) else {
runtime.stopSession()
// `start()` already initialized the shared runtime; finalize it so
// no user dictionary stays open without an owning bridge.
runtime.finalizeRuntime()
throw LibrimeEngineError.schemaUnavailable(schema.rawValue)
}
_ = runtime.setASCIIMode(language == .english)