From acad00c68c75e22741c26ad0a2700fc0127d6993 Mon Sep 17 00:00:00 2001 From: stffrdhrn Date: Sun, 16 Oct 2005 02:40:13 +0000 Subject: [PATCH] fix memory problem with input_method listing SVN revision: 17588 --- src/bin/e_config.c | 2 +- src/bin/e_intl.c | 8 ++++---- src/bin/e_intl.h | 2 +- src/bin/e_ipc_handlers.h | 5 ++++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/bin/e_config.c b/src/bin/e_config.c index 6040ffe..7f97a9b 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -488,7 +488,7 @@ e_config_init(void) e_config->menu_eap_name_show = 1; e_config->menu_eap_generic_show = 1; e_config->menu_eap_comment_show = 0; - e_config->input_method = NULL; + e_config->input_method = NULL; { E_Config_Module *em; diff --git a/src/bin/e_intl.c b/src/bin/e_intl.c index 7f533c9..0417546 100644 --- a/src/bin/e_intl.c +++ b/src/bin/e_intl.c @@ -222,7 +222,7 @@ e_intl_input_method_set(const char *method) e_util_env_set("GTK_IM_MODULE", _e_intl_orig_gtk_im_module); e_util_env_set("QT_IM_MODULE", _e_intl_orig_qt_im_module); e_util_env_set("XMODIFIERS", _e_intl_orig_xmodifiers); - e_util_env_set("GTK_IM_MODULE_FILE", _e_intl_orig_gtk_im_module_file); + e_util_env_set("GTk_IM_MODULE_FILE", _e_intl_orig_gtk_im_module_file); } if (method) @@ -236,7 +236,7 @@ e_intl_input_method_set(const char *method) e_util_env_set("GTK_IM_MODULE", elp->gtk_im_module); e_util_env_set("QT_IM_MODULE", elp->qt_im_module); e_util_env_set("XMODIFIERS", elp->xmodifiers); - e_util_env_set("GTK_IM_MODULE_FILE", elp->gtk_im_module_file); + e_util_env_set("GTk_IM_MODULE_FILE", elp->gtk_im_module_file); if (elp->e_im_exec != NULL) { /* FIXME: first check ok exec availability */ @@ -258,7 +258,7 @@ e_intl_input_method_get(void) return _e_intl_input_method; } -const Evas_List * +Evas_List * e_intl_input_method_list(void) { Evas_List *im_list; @@ -270,7 +270,7 @@ e_intl_input_method_list(void) for (next = _e_intl_input_methods; next; next = next->next) { elp = next->data; - im_list = evas_list_append(im_list, elp->e_im_name); + im_list = evas_list_append(im_list, strdup(elp->e_im_name)); } return im_list; diff --git a/src/bin/e_intl.h b/src/bin/e_intl.h index 50c965e..3b269bd 100644 --- a/src/bin/e_intl.h +++ b/src/bin/e_intl.h @@ -35,7 +35,7 @@ EAPI const Evas_List *e_intl_language_list(void); /* Setting & Getting Input Method */ EAPI void e_intl_input_method_set(const char *method); EAPI const char *e_intl_input_method_get(void); -EAPI const Evas_List *e_intl_input_method_list(void); +EAPI Evas_List *e_intl_input_method_list(void); #endif #endif diff --git a/src/bin/e_ipc_handlers.h b/src/bin/e_ipc_handlers.h index d084148..dbfb935 100644 --- a/src/bin/e_ipc_handlers.h +++ b/src/bin/e_ipc_handlers.h @@ -5457,8 +5457,11 @@ break; #elif (TYPE == E_WM_IN) GENERIC(HDL); LIST_DATA(); - ENCODE((Evas_List *)e_intl_input_method_list(), e_ipc_codec_str_list_enc); + Evas_List *iml; + iml = e_intl_input_method_list(); + ENCODE(iml, e_ipc_codec_str_list_enc); SEND_DATA(E_IPC_OP_IM_LIST_REPLY); + FREE_LIST(iml); END_GENERIC(); #elif (TYPE == E_REMOTE_IN) #endif -- 2.7.4