From: Tae-Hwan Kim Date: Tue, 14 May 2013 05:53:54 +0000 (+0900) Subject: [Genlist] elm module bug fix X-Git-Tag: accepted/tizen/20130927.071315^2~332 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e20e5a429595389e0440bb4237304029706adbec;p=profile%2Fmobile%2Felementary.git [Genlist] elm module bug fix Merge from upstream Change-Id: I78b9a8a8a122ff03811f6720b3f770f322da7199 --- diff --git a/src/lib/elm_module.c b/src/lib/elm_module.c index 757cfd1..cd23f95 100644 --- a/src/lib/elm_module.c +++ b/src/lib/elm_module.c @@ -162,38 +162,42 @@ _elm_module_load(Elm_Module *m) } } - if (!m->module) + if (m->module) return EINA_TRUE; + + snprintf(buf, sizeof(buf), + "%s/elementary/modules/%s/%s/module"EFL_SHARED_EXTENSION, + _elm_lib_dir, m->name, MODULE_ARCH); + m->module = eina_module_new(buf); + if ((m->module) && (eina_module_load(m->module) == EINA_TRUE)) { - snprintf(buf, sizeof(buf), "%s/elementary/modules/%s/%s/module" EFL_SHARED_EXTENSION, _elm_lib_dir, m->name, MODULE_ARCH); - m->module = eina_module_new(buf); - if (m->module && eina_module_load (m->module) == EINA_TRUE) + m->init_func = eina_module_symbol_get(m->module, "elm_modapi_init"); + if (m->init_func) { - m->init_func = eina_module_symbol_get(m->module, "elm_modapi_init"); - if (m->init_func) - { - m->shutdown_func = eina_module_symbol_get(m->module, "elm_modapi_shutdown"); - m->so_path = eina_stringshare_add(buf); - snprintf(buf, sizeof(buf), "%s/elementary/modules/%s/%s", _elm_lib_dir, m->name, MODULE_ARCH); - m->bin_dir = eina_stringshare_add(buf); - snprintf(buf, sizeof(buf), "%s/elementary/modules/%s", _elm_lib_dir, m->name); - m->data_dir = eina_stringshare_add(buf); - } - else + m->shutdown_func = + eina_module_symbol_get(m->module, "elm_modapi_shutdown"); + m->so_path = eina_stringshare_add(buf); + snprintf(buf, sizeof(buf), "%s/elementary/modules/%s/%s", + _elm_lib_dir, m->name, MODULE_ARCH); + m->bin_dir = eina_stringshare_add(buf); + snprintf(buf, sizeof(buf), "%s/elementary/modules/%s", + _elm_lib_dir, m->name); + m->data_dir = eina_stringshare_add(buf); + } + else + { + if (m->module) { - if (m->module) - { - eina_module_unload(m->module); - eina_module_free(m->module); - m->module = NULL; - } - return EINA_FALSE; + eina_module_unload(m->module); + eina_module_free(m->module); + m->module = NULL; } + return EINA_FALSE; } } else if (m->module) { - eina_module_free(m->module); - m->module = NULL; + eina_module_free(m->module); + m->module = NULL; } if (!m->module) return EINA_FALSE;