minor fixes
authorPeng Wu <alexepico@gmail.com>
Sat, 29 Sep 2012 06:45:25 +0000 (14:45 +0800)
committerPeng Wu <alexepico@gmail.com>
Sat, 29 Sep 2012 06:45:25 +0000 (14:45 +0800)
src/lookup/pinyin_lookup2.cpp
src/pinyin.cpp

index 45a9e97..24c0fee 100644 (file)
@@ -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;
index e2f9070..009242d 100644 (file)
@@ -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--;
         }