summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_imf/ecore_imf.c
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2009-10-10 05:28:43 +0000
committerVincent Torri <vincent.torri@gmail.com>2009-10-10 05:28:43 +0000
commit4072d0b23d3c3803932c6f82ec89555b52e3b8a2 (patch)
treeee18a18b8d3d63083a276c94f0387ff5d5636185 /legacy/ecore/src/lib/ecore_imf/ecore_imf.c
parent1d869a9ab18b75ac4c6da60f99841f212ba43eaf (diff)
* check the returned value of the _init() functions
* simplify a bit the init/shutdown functions SVN revision: 42995
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_imf/ecore_imf.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/legacy/ecore/src/lib/ecore_imf/ecore_imf.c b/legacy/ecore/src/lib/ecore_imf/ecore_imf.c
index 66470eb6d9..ff5d25157c 100644
--- a/legacy/ecore/src/lib/ecore_imf/ecore_imf.c
+++ b/legacy/ecore/src/lib/ecore_imf/ecore_imf.c
@@ -18,7 +18,7 @@ EAPI int ECORE_IMF_EVENT_PREEDIT_CHANGED = 0;
18EAPI int ECORE_IMF_EVENT_COMMIT = 0; 18EAPI int ECORE_IMF_EVENT_COMMIT = 0;
19EAPI int ECORE_IMF_EVENT_DELETE_SURROUNDING = 0; 19EAPI int ECORE_IMF_EVENT_DELETE_SURROUNDING = 0;
20 20
21static int init_count = 0; 21static int _ecore_imf_init_count = 0;
22 22
23/** 23/**
24 * @defgroup Ecore_IMF_Lib_Group Ecore Input Method Library Functions 24 * @defgroup Ecore_IMF_Lib_Group Ecore Input Method Library Functions
@@ -36,9 +36,12 @@ static int init_count = 0;
36EAPI int 36EAPI int
37ecore_imf_init(void) 37ecore_imf_init(void)
38{ 38{
39 if (++init_count != 1) return init_count; 39 if (++_ecore_imf_init_count != 1)
40 return _ecore_imf_init_count;
41
42 if (!ecore_init())
43 return --_ecore_imf_init_count;
40 44
41 ecore_init();
42 ecore_imf_module_init(); 45 ecore_imf_module_init();
43 46
44 ECORE_IMF_EVENT_PREEDIT_START = ecore_event_type_new(); 47 ECORE_IMF_EVENT_PREEDIT_START = ecore_event_type_new();
@@ -47,7 +50,7 @@ ecore_imf_init(void)
47 ECORE_IMF_EVENT_COMMIT = ecore_event_type_new(); 50 ECORE_IMF_EVENT_COMMIT = ecore_event_type_new();
48 ECORE_IMF_EVENT_DELETE_SURROUNDING = ecore_event_type_new(); 51 ECORE_IMF_EVENT_DELETE_SURROUNDING = ecore_event_type_new();
49 52
50 return init_count; 53 return _ecore_imf_init_count;
51} 54}
52 55
53/** 56/**
@@ -59,10 +62,11 @@ ecore_imf_init(void)
59EAPI int 62EAPI int
60ecore_imf_shutdown(void) 63ecore_imf_shutdown(void)
61{ 64{
62 if (--init_count != 0) return init_count; 65 if (--_ecore_imf_init_count != 0)
66 return _ecore_imf_init_count;
63 67
64 ecore_shutdown(); 68 ecore_shutdown();
65 ecore_imf_module_shutdown(); 69 ecore_imf_module_shutdown();
66 70
67 return init_count; 71 return _ecore_imf_init_count;
68} 72}