evas - fix evas module locks to init/del when movile created/destroyed

we initted when we load and unload. this led to races with
locking/unlocking elsewhere as these expected us to be initted and we
were not yet. this fixes that!

@fix
This commit is contained in:
Carsten Haitzler 2015-12-12 23:37:16 +09:00
parent 0848792204
commit 22869bb94e
1 changed files with 2 additions and 2 deletions

View File

@ -304,6 +304,7 @@ evas_module_register(const Evas_Module_Api *module, Evas_Module_Type type)
em = calloc(1, sizeof (Evas_Module));
if (!em) return EINA_FALSE;
LKI(em->lock);
em->definition = module;
if (type == EVAS_MODULE_TYPE_ENGINE)
@ -405,6 +406,7 @@ evas_module_unregister(const Evas_Module_Api *module, Evas_Module_Type type)
eina_array_data_set(evas_engines, em->id_engine - 1, NULL);
eina_hash_del(evas_modules[type], module->name, em);
LKD(em->lock);
free(em);
return EINA_TRUE;
@ -512,7 +514,6 @@ evas_module_load(Evas_Module *em)
if (!em->definition->func.open(em)) return 0;
em->loaded = 1;
LKI(em->lock);
return 1;
}
@ -528,7 +529,6 @@ evas_module_unload(Evas_Module *em)
// em->definition->func.close(em);
// em->loaded = 0;
LKD(em->lock);
}
void