summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-09-29 14:45:25 +0800
committerPeng Wu <alexepico@gmail.com>2012-09-29 14:45:25 +0800
commit7332b902fcd943e2302056cd4d7fc12ec559aa60 (patch)
tree033f55b63b9912c315c42c39fc331cc4a4d0b066
parentb449a30c6e3a9138c0d6fd32b9b6545e4fc79cac (diff)
downloadlibpinyin-7332b902fcd943e2302056cd4d7fc12ec559aa60.zip
libpinyin-7332b902fcd943e2302056cd4d7fc12ec559aa60.tar.gz
libpinyin-7332b902fcd943e2302056cd4d7fc12ec559aa60.tar.xz
minor fixes
-rw-r--r--src/lookup/pinyin_lookup2.cpp1
-rw-r--r--src/pinyin.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/lookup/pinyin_lookup2.cpp b/src/lookup/pinyin_lookup2.cpp
index 45a9e97..24c0fee 100644
--- a/src/lookup/pinyin_lookup2.cpp
+++ b/src/lookup/pinyin_lookup2.cpp
@@ -301,6 +301,7 @@ bool PinyinLookup2::search_unigram2(GPtrArray * topresults, int nstep,
for ( size_t m = 0; m < PHRASE_INDEX_LIBRARY_COUNT; ++m){
GArray * array = ranges[m];
if ( !array ) continue;
+
for ( size_t n = 0; n < array->len; ++n){
PhraseIndexRange * range = &g_array_index(array, PhraseIndexRange, n);
for ( phrase_token_t token = range->m_range_begin;
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index e2f9070..009242d 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -1053,6 +1053,7 @@ static bool _remove_duplicated_items_by_phrase_string
(candidates, lookup_candidate_t, i);
if (ZOMBIE_CANDIDATE == candidate->m_candidate_type) {
+ g_free(candidate->m_phrase_string);
g_array_remove_index(candidates, i);
i--;
}