diff options
author | Peng Wu <alexepico@gmail.com> | 2012-04-10 10:48:36 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-04-10 10:48:36 +0800 |
commit | 7a2b74326e066f4672207199971c9ce41dc31a39 (patch) | |
tree | 5796b21ccf58441826905acfe0479e0b5a64b99d | |
parent | 0ff6dabf0a1c0e5678487d8d273b21e2a1c65ff0 (diff) | |
download | ibus-libpinyin-7a2b74326e066f4672207199971c9ce41dc31a39.tar.gz |
fixes commit in bopomofo editor
-rw-r--r-- | src/PYPBopomofoEditor.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/PYPBopomofoEditor.cc b/src/PYPBopomofoEditor.cc index c3b0402..460fed6 100644 --- a/src/PYPBopomofoEditor.cc +++ b/src/PYPBopomofoEditor.cc @@ -260,12 +260,14 @@ LibPinyinBopomofoEditor::commit () /* sentence candidate */ char *tmp = NULL; pinyin_get_sentence(m_instance, &tmp); - if (m_props.modeSimp ()) { - m_buffer << tmp; - } else { - SimpTradConverter::simpToTrad (tmp, m_buffer); + if (tmp) { + if (m_props.modeSimp ()) { + m_buffer << tmp; + } else { + SimpTradConverter::simpToTrad (tmp, m_buffer); + } + g_free (tmp); } - g_free (tmp); /* text after pinyin */ const gchar *p = m_text.c_str() + m_pinyin_len; |