summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-05-29 09:31:49 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-05-29 12:29:04 -0400
commit3a88a71a26f3bd151b2b8b8ba84dd7e3b48b8906 (patch)
treea11d703966df7294e1174290d8ea52fe4c8b0d23
parent7b5fa23e9bee76531ec8f9ce6d17f06c9a18c3de (diff)
ecore-imf/xim: only call ecore_x_shutdown if init was previously called
Summary: this isn't a perfect fix, but it's probably the best that can be done given the current ecore-imf module api which calls the exit() module function unconditionally during module cleanup even if the module was never initialized @fix Depends on D9003 Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9005
-rw-r--r--src/modules/ecore_imf/xim/ecore_imf_xim.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/modules/ecore_imf/xim/ecore_imf_xim.c b/src/modules/ecore_imf/xim/ecore_imf_xim.c
index ba5dad58ab..a4d567c376 100644
--- a/src/modules/ecore_imf/xim/ecore_imf_xim.c
+++ b/src/modules/ecore_imf/xim/ecore_imf_xim.c
@@ -130,6 +130,8 @@ static void _ecore_imf_xim_destroy_cb(XIM xim,
130 XPointer call_data); 130 XPointer call_data);
131static void _ecore_imf_xim_im_setup(XIM_Im_Info *info); 131static void _ecore_imf_xim_im_setup(XIM_Im_Info *info);
132 132
133static unsigned int init_count;
134
133static unsigned int 135static unsigned int
134_ecore_imf_xim_utf8_offset_to_index(const char *str, int offset) 136_ecore_imf_xim_utf8_offset_to_index(const char *str, int offset)
135{ 137{
@@ -752,6 +754,7 @@ xim_imf_module_create(void)
752 754
753 if (!ecore_x_init(NULL)) 755 if (!ecore_x_init(NULL))
754 return NULL; 756 return NULL;
757 init_count++;
755 ctx = ecore_imf_context_new(&xim_class); 758 ctx = ecore_imf_context_new(&xim_class);
756 DBG("ctx=%p", ctx); 759 DBG("ctx=%p", ctx);
757 return ctx; 760 return ctx;
@@ -760,7 +763,11 @@ xim_imf_module_create(void)
760static Ecore_IMF_Context * 763static Ecore_IMF_Context *
761xim_imf_module_exit(void) 764xim_imf_module_exit(void)
762{ 765{
763 ecore_x_shutdown(); 766 if (init_count)
767 {
768 ecore_x_shutdown();
769 init_count--;
770 }
764 DBG(" "); 771 DBG(" ");
765 return NULL; 772 return NULL;
766} 773}