summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2015-10-17 11:38:00 +0800
committerPeng Wu <alexepico@gmail.com>2015-10-17 11:38:00 +0800
commit46e538b87c97b33545a951b49133bdb34bb9206d (patch)
treecb1094c9a4d88db1059a8c0e2f3589874fac1568
parent69aeaf03a8b0694269108a7a2d4297b7ddec289f (diff)
downloadlibpinyin-46e538b87c97b33545a951b49133bdb34bb9206d.tar.gz
fixes ZhuyinSimpleParser2::in_chewing_schem method
-rw-r--r--src/storage/zhuyin_parser2.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/storage/zhuyin_parser2.cpp b/src/storage/zhuyin_parser2.cpp
index 5788db8..9047947 100644
--- a/src/storage/zhuyin_parser2.cpp
+++ b/src/storage/zhuyin_parser2.cpp
@@ -310,8 +310,10 @@ bool ZhuyinSimpleParser2::in_chewing_scheme(pinyin_option_t options,
return true;
}
- if (!(options & USE_TONE))
+ if (!(options & USE_TONE)) {
+ g_ptr_array_free(array, TRUE);
return false;
+ }
if (search_chewing_tones(m_tone_table, key, &tone)) {
g_ptr_array_add(array, g_strdup(chewing_tone_table[tone]));
@@ -321,6 +323,7 @@ bool ZhuyinSimpleParser2::in_chewing_scheme(pinyin_option_t options,
return true;
}
+ g_ptr_array_free(array, TRUE);
return false;
}