From: huiyu.eun Date: Thu, 29 Jun 2017 00:53:23 +0000 (+0900) Subject: [SDL_Tizen] delete ecore_imf_callback X-Git-Tag: accepted/tizen/unified/20170710.154330~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=edeb9a8aa7dcd9a4bce215d56622d183129b7642;hp=9474e80f426e1df176d7f8a1e73f5b68eef00765;p=platform%2Fupstream%2FSDL.git [SDL_Tizen] delete ecore_imf_callback -ecore_imf_context_event_callback_add(...) allocates memory which is released using ecore_imf_context_event_callback_del(...) -Documentation : https://docs.enlightenment.org/auto/group__Ecore__IMF__Context__Group.html#ga7e0ef28b49fbdc54c4657d88a139d5f5 Change-Id: I8be41c3b7426954b46d97377e902ba0b3e86a770 Signed-off-by: huiyu.eun --- diff --git a/src/video/tizen/SDL_tizenkeyboard.c b/src/video/tizen/SDL_tizenkeyboard.c index 39da3f8..801c923 100755 --- a/src/video/tizen/SDL_tizenkeyboard.c +++ b/src/video/tizen/SDL_tizenkeyboard.c @@ -79,10 +79,10 @@ void Tizen_InitKeyboard(_THIS) const char *default_id = ecore_imf_context_default_id_get(); if (!default_id) - { - SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Can't create ecore_imf_context\n"); - return; - } + { + SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Can't create ecore_imf_context\n"); + return; + } tizen_keyboard.imf_context = ecore_imf_context_add(default_id); @@ -92,9 +92,7 @@ void Tizen_InitKeyboard(_THIS) ecore_imf_context_client_window_set(tizen_keyboard.imf_context, (void*)wind->id); ecore_imf_context_event_callback_add(tizen_keyboard.imf_context, ECORE_IMF_CALLBACK_COMMIT , _ecore_imf_event_commit_cb, NULL); - ecore_imf_context_event_callback_add(tizen_keyboard.imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _ecore_imf_event_preedit_changed_cb, NULL); - ecore_imf_context_input_panel_event_callback_add (tizen_keyboard.imf_context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, _ecore_imf_event_state_change_cb, NULL); ecore_imf_context_cursor_position_set(tizen_keyboard.imf_context, 0); @@ -110,6 +108,10 @@ void Tizen_FiniKeyboard(void) if(tizen_keyboard.imf_context == NULL) return; + ecore_imf_context_event_callback_del(tizen_keyboard.imf_context, ECORE_IMF_CALLBACK_COMMIT, _ecore_imf_event_commit_cb); + ecore_imf_context_event_callback_del(tizen_keyboard.imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _ecore_imf_event_preedit_changed_cb); + ecore_imf_context_input_panel_event_callback_del(tizen_keyboard.imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _ecore_imf_event_preedit_changed_cb); + ecore_imf_context_del(tizen_keyboard.imf_context); tizen_keyboard.imf_context = NULL; @@ -137,7 +139,6 @@ Tizen_StartTextInput(_THIS) Tizen_ShowScreenKeyboard(_this, window); } - void Tizen_StopTextInput(_THIS) { @@ -152,14 +153,12 @@ void Tizen_SetTextInputRect(void) { } - SDL_bool Tizen_HasScreenKeyboardSupport(_THIS) { return SDL_TRUE; } - void Tizen_ShowScreenKeyboard(_THIS, SDL_Window * window) {