diff options
Diffstat (limited to 'src/pinyin.cpp')
-rw-r--r-- | src/pinyin.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 2bf3b89..a8939f0 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -355,8 +355,12 @@ void pinyin_fini(pinyin_context_t * context){ g_free(context->m_user_dir); context->m_modified = false; - g_free(context->m_phrase_indices[1]); - g_free(context->m_phrase_indices[2]); + for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) { + gchar * & phrasefilename = context->m_phrase_indices[i]; + if (phrasefilename) { + g_free(phrasefilename); + } + } delete context; } |