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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user