summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lookup/phrase_lookup.cpp4
-rw-r--r--src/lookup/pinyin_lookup2.cpp5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/lookup/phrase_lookup.cpp b/src/lookup/phrase_lookup.cpp
index 114ecb4..f7da0b7 100644
--- a/src/lookup/phrase_lookup.cpp
+++ b/src/lookup/phrase_lookup.cpp
@@ -106,6 +106,10 @@ PhraseLookup::PhraseLookup(const gfloat lambda,
m_steps_index = g_ptr_array_new();
m_steps_content = g_ptr_array_new();
+
+ /* the member variables below are saved in get_best_match call. */
+ m_sentence = NULL;
+ m_sentence_length = 0;
}
PhraseLookup::~PhraseLookup(){
diff --git a/src/lookup/pinyin_lookup2.cpp b/src/lookup/pinyin_lookup2.cpp
index 8be5c0c..2250a93 100644
--- a/src/lookup/pinyin_lookup2.cpp
+++ b/src/lookup/pinyin_lookup2.cpp
@@ -202,6 +202,10 @@ PinyinLookup2::PinyinLookup2(const gfloat lambda,
m_steps_index = g_ptr_array_new();
m_steps_content = g_ptr_array_new();
+
+ /* the member variables below are saved in get_best_match call. */
+ m_keys = NULL;
+ m_constraints = NULL;
}
PinyinLookup2::~PinyinLookup2(){
@@ -594,6 +598,7 @@ bool PinyinLookup2::train_result2(ChewingKeyVector keys,
assert(user->set_freq(*token, freq + seed));
assert(m_user_bigram->store(last_token, user));
next:
+ assert(NULL != user);
if (user)
delete user;
}