From eb886add0e9dade895a5772077b7c90e5ccac792 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Fri, 4 Jun 2010 06:36:54 +0000 Subject: [PATCH] be mroe explicit on keeping im handle. SVN revision: 49444 --- legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c | 24 +++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c index 32c27f5416..a3d7d87a3c 100644 --- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c +++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c @@ -63,6 +63,7 @@ int _ecore_x_event_last_root_x = 0; int _ecore_x_event_last_root_y = 0; int _ecore_x_xcursor = 0; XIC _ecore_x_ic = NULL; /* Input context for composed characters */ +XIM _ecore_x_im = NULL; Ecore_X_Window _ecore_x_private_win = 0; @@ -538,8 +539,11 @@ ecore_x_init(const char *name) if (ret || !supported_styles) goto _im_create_error; for (i = 0; i < supported_styles->count_styles; i++) - if (supported_styles->supported_styles[i] == (XIMPreeditNothing | XIMStatusNothing)) - chosen_style = supported_styles->supported_styles[i]; + { + if (supported_styles->supported_styles[i] == + (XIMPreeditNothing | XIMStatusNothing)) + chosen_style = supported_styles->supported_styles[i]; + } XFree(supported_styles); if (!chosen_style) goto _im_create_error; @@ -547,6 +551,7 @@ ecore_x_init(const char *name) if (ic) { _ecore_x_ic = ic; + _ecore_x_im = im; goto _im_create_end; } _im_create_error: @@ -556,16 +561,15 @@ _im_create_end: #endif return _ecore_x_init_count; - free_event_handlers: +free_event_handlers: free(_ecore_x_event_handlers); _ecore_x_event_handlers = NULL; - close_display: +close_display: XCloseDisplay(_ecore_x_disp); _ecore_x_fd_handler_handle = NULL; _ecore_x_disp = NULL; - shutdown_ecore_event: +shutdown_ecore_event: ecore_event_shutdown(); - return --_ecore_x_init_count; } @@ -581,12 +585,14 @@ _ecore_x_shutdown(int close_display) #ifdef ENABLE_XIM if (_ecore_x_ic) { - XIM xim; - xim = XIMOfIC(_ecore_x_ic); XDestroyIC(_ecore_x_ic); - XCloseIM(xim); _ecore_x_ic = NULL; } + if (_ecore_x_im) + { + XCloseIM(_ecore_x_im); + _ecore_x_im = NULL; + } #endif if (close_display) XCloseDisplay(_ecore_x_disp);