Summary:
When _access_init was called, initted will be increased always even though failed to initialize.
This patch will fix this problem.
Signed-off-by: Jonghee Choi <joi.choi@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Reviewers: cedric, Hermet
Reviewed By: Hermet
Subscribers: joi.choi, jpeg
Differential Revision: https://phab.enlightenment.org/D4466
Change-Id: I4e36a24cbe4a42cb5e491681d3f81807bb74490e
_access_init(void)
{
Elm_Module *m;
- initted++;
- if (initted > 1) return;
+
+ if (initted > 0) return;
if (!(m = _elm_module_find_as("access/api"))) return;
+ if (m->init_func(m) < 0) return;
+ initted++;
+
m->api = malloc(sizeof(Mod_Api));
if (!m->api) return;
- m->init_func(m);
((Mod_Api *)(m->api) )->out_read = // called to read out some text
_elm_module_symbol_get(m, "out_read");
((Mod_Api *)(m->api) )->out_read_done = // called to set a done marker so when it is reached the done callback is called