File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ static gboolean is_output_simplified;
108108static gboolean is_aux_shown = FALSE;
109109static ArrayContext * array_context = NULL ;
110110#ifdef HAVE_OPENCC
111- static opencc_t cc_handle ;
111+ static opencc_t cc_handle = NULL ; ;
112112#endif
113113
114114GType ibus_array_engine_get_type (void ) {
@@ -173,7 +173,8 @@ void ibus_array_init (IBusBus *bus) {
173173void ibus_array_exit (void )
174174{
175175#ifdef HAVE_OPENCC
176- opencc_close (cc_handle );
176+ if (cc_handle )
177+ opencc_close (cc_handle );
177178#endif
178179
179180 array_release_context (array_context );
@@ -442,7 +443,7 @@ static gboolean ibus_array_engine_commit_current_candidate (IBusArrayEngine *arr
442443 }
443444
444445#ifdef HAVE_OPENCC
445- if (is_output_simplified ) {
446+ if (is_output_simplified && cc_handle != NULL ) {
446447 char * converted = opencc_convert_utf8 (cc_handle ,
447448 text -> text ,
448449 strlen (text -> text ));
You can’t perform that action at this time.
0 commit comments