diff options
author | Vincent Torri <vincent.torri@gmail.com> | 2009-10-10 05:28:43 +0000 |
---|---|---|
committer | Vincent Torri <vincent.torri@gmail.com> | 2009-10-10 05:28:43 +0000 |
commit | 4072d0b23d3c3803932c6f82ec89555b52e3b8a2 (patch) | |
tree | ee18a18b8d3d63083a276c94f0387ff5d5636185 /legacy/ecore/src/lib/ecore_imf/ecore_imf.c | |
parent | 1d869a9ab18b75ac4c6da60f99841f212ba43eaf (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.c | 16 |
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; | |||
18 | EAPI int ECORE_IMF_EVENT_COMMIT = 0; | 18 | EAPI int ECORE_IMF_EVENT_COMMIT = 0; |
19 | EAPI int ECORE_IMF_EVENT_DELETE_SURROUNDING = 0; | 19 | EAPI int ECORE_IMF_EVENT_DELETE_SURROUNDING = 0; |
20 | 20 | ||
21 | static int init_count = 0; | 21 | static 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; | |||
36 | EAPI int | 36 | EAPI int |
37 | ecore_imf_init(void) | 37 | ecore_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) | |||
59 | EAPI int | 62 | EAPI int |
60 | ecore_imf_shutdown(void) | 63 | ecore_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 | } |