From cc75f7cc66f0374071503223f4838b0d739d6db7 Mon Sep 17 00:00:00 2001 From: Lukhnos Liu Date: Mon, 21 Oct 2024 04:09:38 -0400 Subject: [PATCH] Sync with upstream engine code --- src/Engine/McBopomofoLM.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Engine/McBopomofoLM.cpp b/src/Engine/McBopomofoLM.cpp index 0bb3107..f498ae3 100644 --- a/src/Engine/McBopomofoLM.cpp +++ b/src/Engine/McBopomofoLM.cpp @@ -56,12 +56,13 @@ void McBopomofoLM::loadAssociatedPhrasesV2(const char* associatedPhrasesPath) { void McBopomofoLM::loadUserPhrases(const char* userPhrasesDataPath, const char* excludedPhrasesDataPath) { + userPhrases_.close(); + excludedPhrases_.close(); + if (userPhrasesDataPath) { - userPhrases_.close(); userPhrases_.open(userPhrasesDataPath); } if (excludedPhrasesDataPath) { - excludedPhrases_.close(); excludedPhrases_.open(excludedPhrasesDataPath); } }