Skip to content

Commit f215633

Browse files
committed
fix(Rime.java): ensure deploy opencc dictionaries each time startup librime (osfans#960)
1 parent 16128ff commit f215633

File tree

1 file changed

+8
-6
lines changed
  • app/src/main/java/com/osfans/trime/core

1 file changed

+8
-6
lines changed

app/src/main/java/com/osfans/trime/core/Rime.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ public static String getComposingText() {
197197

198198
public Rime(boolean full_check) {
199199
startup(full_check);
200-
self = this;
200+
}
201+
202+
public static void destroy() {
203+
exitRime();
204+
self = null;
201205
}
202206

203207
public static void initSchema() {
@@ -228,8 +232,9 @@ private static void startup(boolean full_check) {
228232
}
229233

230234
public static void deploy() {
231-
exitRime();
232-
startup(true);
235+
destroy();
236+
Rime.get(true);
237+
OpenCCDictManager.buildOpenCCDict();
233238
}
234239

235240
public static String getCommitText() {
@@ -358,9 +363,6 @@ public static boolean selectSchema(String schemaId) {
358363

359364
public static Rime get(boolean full_check) {
360365
if (self == null) {
361-
if (full_check) {
362-
OpenCCDictManager.buildOpenCCDict();
363-
}
364366
self = new Rime(full_check);
365367
}
366368
return self;

0 commit comments

Comments
 (0)