ChewingLargeTable * m_system_chewing_table;
ChewingLargeTable * m_user_chewing_table;
+ void reset() {
+ if (m_system_chewing_table) {
+ delete m_system_chewing_table;
+ m_system_chewing_table = NULL;
+ }
+
+ if (m_user_chewing_table) {
+ delete m_user_chewing_table;
+ m_user_chewing_table = NULL;
+ }
+ }
public:
/**
* FacadeChewingTable::FacadeChewingTable:
}
/**
+ * FacadeChewingTable::~FacadeChewingTable:
+ *
+ * The destructor of the FacadeChewingTable.
+ *
+ */
+ ~FacadeChewingTable() {
+ reset();
+ }
+
+ /**
* FacadeChewingTable::set_options:
* @options: the pinyin options.
* @returns: whether the setting options is successful.
*/
bool load(pinyin_option_t options, MemoryChunk * system,
MemoryChunk * user){
+ reset();
+
bool result = false;
if (system) {
m_system_chewing_table = new ChewingLargeTable(options);