summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-04 20:07:30 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-04 21:30:34 +0900
commit9527240d7422ff828f29c54df2211dd9374c2867 (patch)
tree7d3eb05f406b2750f448fea5dfe433441b66bc52
parent49f19a1cb207e148a5d4057f848fbd58edcbccd9 (diff)
efl - fix lots of little init/shutdown pairs that are wrong
i've fixed almost all the eina init/shutdown pairs to do the right thing now... except one (ecore_shutdown) with comment inline where eo_shutdown is not called. if this is called we are in crash land. this needs further inspection.
-rw-r--r--src/lib/ecore/ecore.c5
-rw-r--r--src/lib/efreet/efreet_cache.c3
-rw-r--r--src/lib/embryo/embryo_main.c1
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_eet.c3
-rw-r--r--src/lib/evas/canvas/evas_main.c7
-rw-r--r--src/lib/evas/file/evas_module.c30
-rw-r--r--src/modules/ecore_imf/xim/ecore_imf_xim.c1
-rw-r--r--src/modules/evas/image_loaders/eet/evas_image_load_eet.c2
-rw-r--r--src/modules/evas/model_loaders/ply/evas_model_load_ply.c2
-rw-r--r--src/modules/evas/model_savers/obj/evas_model_save_obj.c2
10 files changed, 43 insertions, 13 deletions
diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index 5a9e2d2a09..6431a64ddd 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -439,13 +439,14 @@ ecore_shutdown(void)
439 eina_prefix_free(_ecore_pfx); 439 eina_prefix_free(_ecore_pfx);
440 _ecore_pfx = NULL; 440 _ecore_pfx = NULL;
441 441
442 eo_unref(_ecore_parent);
443 eo_shutdown();
444
442 eina_shutdown(); 445 eina_shutdown();
443#ifdef HAVE_EVIL 446#ifdef HAVE_EVIL
444 evil_shutdown(); 447 evil_shutdown();
445#endif 448#endif
446 449
447 eo_unref(_ecore_parent);
448 eo_shutdown();
449 end: 450 end:
450 return _ecore_init_count; 451 return _ecore_init_count;
451} 452}
diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c
index 88fda2e6a3..4211ca748f 100644
--- a/src/lib/efreet/efreet_cache.c
+++ b/src/lib/efreet/efreet_cache.c
@@ -360,6 +360,9 @@ efreet_cache_shutdown(void)
360 if (hnd_add) ecore_event_handler_del(hnd_add); 360 if (hnd_add) ecore_event_handler_del(hnd_add);
361 if (hnd_del) ecore_event_handler_del(hnd_del); 361 if (hnd_del) ecore_event_handler_del(hnd_del);
362 if (hnd_data) ecore_event_handler_del(hnd_data); 362 if (hnd_data) ecore_event_handler_del(hnd_data);
363
364 ecore_ipc_shutdown();
365
363 ipc = NULL; 366 ipc = NULL;
364 pfx = NULL; 367 pfx = NULL;
365 hnd_add = NULL; 368 hnd_add = NULL;
diff --git a/src/lib/embryo/embryo_main.c b/src/lib/embryo/embryo_main.c
index 37fc811b6e..4b2af3c5e5 100644
--- a/src/lib/embryo/embryo_main.c
+++ b/src/lib/embryo/embryo_main.c
@@ -64,6 +64,7 @@ embryo_shutdown(void)
64 64
65 eina_log_domain_unregister(_embryo_default_log_dom); 65 eina_log_domain_unregister(_embryo_default_log_dom);
66 _embryo_default_log_dom = -1; 66 _embryo_default_log_dom = -1;
67 eina_shutdown();
67 68
68 return _embryo_init_count; 69 return _embryo_init_count;
69} 70}
diff --git a/src/lib/evas/canvas/evas_canvas3d_eet.c b/src/lib/evas/canvas/evas_canvas3d_eet.c
index 353e291d49..4a0cc4f729 100644
--- a/src/lib/evas/canvas/evas_canvas3d_eet.c
+++ b/src/lib/evas/canvas/evas_canvas3d_eet.c
@@ -37,9 +37,6 @@ _evas_canvas3d_eet_file_get()
37void 37void
38_evas_canvas3d_eet_file_init() 38_evas_canvas3d_eet_file_init()
39{ 39{
40 eina_init();
41 eet_init();
42
43/* initialization of bonding between structure units in eet file */ 40/* initialization of bonding between structure units in eet file */
44 Eet_Data_Descriptor_Class eddc; 41 Eet_Data_Descriptor_Class eddc;
45 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Evas_Canvas3D_Vec2_Eet); 42 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Evas_Canvas3D_Vec2_Eet);
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index f2c9b444b7..7f7afa2f54 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -43,6 +43,9 @@ evas_init(void)
43 if (!eina_init()) 43 if (!eina_init())
44 goto shutdown_evil; 44 goto shutdown_evil;
45 45
46 if (!eet_init())
47 goto shutdown_eet;
48
46 _evas_log_dom_global = eina_log_domain_register 49 _evas_log_dom_global = eina_log_domain_register
47 ("evas_main", EVAS_DEFAULT_LOG_COLOR); 50 ("evas_main", EVAS_DEFAULT_LOG_COLOR);
48 if (_evas_log_dom_global < 0) 51 if (_evas_log_dom_global < 0)
@@ -81,6 +84,8 @@ evas_init(void)
81 shutdown_module: 84 shutdown_module:
82 evas_module_shutdown(); 85 evas_module_shutdown();
83 eina_log_domain_unregister(_evas_log_dom_global); 86 eina_log_domain_unregister(_evas_log_dom_global);
87 shutdown_eet:
88 eet_shutdown();
84 shutdown_eina: 89 shutdown_eina:
85 eina_shutdown(); 90 eina_shutdown();
86 shutdown_evil: 91 shutdown_evil:
@@ -145,6 +150,8 @@ evas_shutdown(void)
145 150
146 eina_log_domain_unregister(_evas_log_dom_global); 151 eina_log_domain_unregister(_evas_log_dom_global);
147 152
153 eet_shutdown();
154
148 eina_shutdown(); 155 eina_shutdown();
149#ifdef HAVE_EVIL 156#ifdef HAVE_EVIL
150 evil_shutdown(); 157 evil_shutdown();
diff --git a/src/lib/evas/file/evas_module.c b/src/lib/evas/file/evas_module.c
index cda2dafe69..a684f847c4 100644
--- a/src/lib/evas/file/evas_module.c
+++ b/src/lib/evas/file/evas_module.c
@@ -406,6 +406,13 @@ evas_module_unregister(const Evas_Module_Api *module, Evas_Module_Type type)
406 eina_array_data_set(evas_engines, em->id_engine - 1, NULL); 406 eina_array_data_set(evas_engines, em->id_engine - 1, NULL);
407 407
408 eina_hash_del(evas_modules[type], module->name, em); 408 eina_hash_del(evas_modules[type], module->name, em);
409
410 if (em->loaded)
411 {
412 em->definition->func.close(em);
413 em->loaded = 0;
414 }
415
409 LKD(em->lock); 416 LKD(em->lock);
410 free(em); 417 free(em);
411 418
@@ -431,7 +438,11 @@ evas_module_find_type(Evas_Module_Type type, const char *name)
431 if ((unsigned int)type > 3) return NULL; 438 if ((unsigned int)type > 3) return NULL;
432 439
433 em = eina_hash_find(evas_modules[type], name); 440 em = eina_hash_find(evas_modules[type], name);
434 if (em) return em; 441 if (em)
442 {
443 evas_module_load(em);
444 return em;
445 }
435 446
436 run_in_tree = !!getenv("EFL_RUN_IN_TREE"); 447 run_in_tree = !!getenv("EFL_RUN_IN_TREE");
437 448
@@ -607,6 +618,18 @@ evas_module_clean(void)
607 618
608static Eina_Prefix *pfx = NULL; 619static Eina_Prefix *pfx = NULL;
609 620
621static Eina_Bool
622_cb_mod_close(const Eina_Hash *hash EINA_UNUSED,
623 const void *key EINA_UNUSED,
624 void *data, void *fdata EINA_UNUSED)
625{
626 Evas_Module *em = data;
627
628 em->definition->func.close(em);
629 em->loaded = 0;
630 return EINA_TRUE;
631}
632
610/* will dlclose all the modules loaded and free all the structs */ 633/* will dlclose all the modules loaded and free all the structs */
611void 634void
612evas_module_shutdown(void) 635evas_module_shutdown(void)
@@ -629,6 +652,11 @@ evas_module_shutdown(void)
629// eina_module_free(en); 652// eina_module_free(en);
630 } 653 }
631 654
655 eina_hash_foreach(evas_modules[EVAS_MODULE_TYPE_ENGINE], _cb_mod_close, NULL);
656 eina_hash_foreach(evas_modules[EVAS_MODULE_TYPE_IMAGE_LOADER], _cb_mod_close, NULL);
657 eina_hash_foreach(evas_modules[EVAS_MODULE_TYPE_IMAGE_SAVER], _cb_mod_close, NULL);
658 eina_hash_foreach(evas_modules[EVAS_MODULE_TYPE_OBJECT], _cb_mod_close, NULL);
659
632 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_ENGINE]); 660 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_ENGINE]);
633 evas_modules[EVAS_MODULE_TYPE_ENGINE] = NULL; 661 evas_modules[EVAS_MODULE_TYPE_ENGINE] = NULL;
634 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_IMAGE_LOADER]); 662 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_IMAGE_LOADER]);
diff --git a/src/modules/ecore_imf/xim/ecore_imf_xim.c b/src/modules/ecore_imf/xim/ecore_imf_xim.c
index 99213a4095..5258c74098 100644
--- a/src/modules/ecore_imf/xim/ecore_imf_xim.c
+++ b/src/modules/ecore_imf/xim/ecore_imf_xim.c
@@ -767,7 +767,6 @@ _ecore_imf_xim_init(void)
767 if (_ecore_imf_xim_log_dom < 0) 767 if (_ecore_imf_xim_log_dom < 0)
768 { 768 {
769 EINA_LOG_ERR("Could not register log domain: ecore_imf_xim"); 769 EINA_LOG_ERR("Could not register log domain: ecore_imf_xim");
770 return EINA_FALSE;
771 } 770 }
772 771
773 DBG(" "); 772 DBG(" ");
diff --git a/src/modules/evas/image_loaders/eet/evas_image_load_eet.c b/src/modules/evas/image_loaders/eet/evas_image_load_eet.c
index 4e1f168b00..9ff212f8eb 100644
--- a/src/modules/evas/image_loaders/eet/evas_image_load_eet.c
+++ b/src/modules/evas/image_loaders/eet/evas_image_load_eet.c
@@ -237,7 +237,6 @@ static int
237module_open(Evas_Module *em) 237module_open(Evas_Module *em)
238{ 238{
239 if (!em) return 0; 239 if (!em) return 0;
240 eet_init();
241 em->functions = (void *)(&evas_image_load_eet_func); 240 em->functions = (void *)(&evas_image_load_eet_func);
242 return 1; 241 return 1;
243} 242}
@@ -245,7 +244,6 @@ module_open(Evas_Module *em)
245static void 244static void
246module_close(Evas_Module *em EINA_UNUSED) 245module_close(Evas_Module *em EINA_UNUSED)
247{ 246{
248 eet_shutdown();
249} 247}
250 248
251static Evas_Module_Api evas_modapi = 249static Evas_Module_Api evas_modapi =
diff --git a/src/modules/evas/model_loaders/ply/evas_model_load_ply.c b/src/modules/evas/model_loaders/ply/evas_model_load_ply.c
index 9135a00281..eb4228b19f 100644
--- a/src/modules/evas/model_loaders/ply/evas_model_load_ply.c
+++ b/src/modules/evas/model_loaders/ply/evas_model_load_ply.c
@@ -44,8 +44,6 @@ _read_data(float *array, int place, int count, char *current, float divider)
44static inline Eina_Bool 44static inline Eina_Bool
45_read_ply_header(char *map, Evas_Model_Load_Save_Header *header) 45_read_ply_header(char *map, Evas_Model_Load_Save_Header *header)
46{ 46{
47 eina_init();
48
49 Eina_Bool reading_vertices = EINA_TRUE, check_next_char = EINA_FALSE; 47 Eina_Bool reading_vertices = EINA_TRUE, check_next_char = EINA_FALSE;
50 int vertex_lines, triangles = 0, vertices_in_current_face = 0; 48 int vertex_lines, triangles = 0, vertices_in_current_face = 0;
51 char **helping_pointer; 49 char **helping_pointer;
diff --git a/src/modules/evas/model_savers/obj/evas_model_save_obj.c b/src/modules/evas/model_savers/obj/evas_model_save_obj.c
index 09e5c723c6..2b5db86800 100644
--- a/src/modules/evas/model_savers/obj/evas_model_save_obj.c
+++ b/src/modules/evas/model_savers/obj/evas_model_save_obj.c
@@ -94,7 +94,6 @@ _write_obj_vertex_data(FILE *file,
94 Eina_Stringshare *str, *cur_str, *cur_index; 94 Eina_Stringshare *str, *cur_str, *cur_index;
95 unsigned short cur_hu; 95 unsigned short cur_hu;
96 96
97 eina_init();
98 Eina_Hash *vb; 97 Eina_Hash *vb;
99#define WRITE_OBJ_VERTEX_DATA(name, num, format) \ 98#define WRITE_OBJ_VERTEX_DATA(name, num, format) \
100 if (header.existence_of_##name) \ 99 if (header.existence_of_##name) \
@@ -126,7 +125,6 @@ _write_obj_vertex_data(FILE *file,
126 WRITE_OBJ_VERTEX_DATA(tex_coords, 2, "vt") 125 WRITE_OBJ_VERTEX_DATA(tex_coords, 2, "vt")
127 WRITE_OBJ_VERTEX_DATA(normals, 3, "vn") 126 WRITE_OBJ_VERTEX_DATA(normals, 3, "vn")
128#undef WRITE_OBJ_VERTEX_DATA 127#undef WRITE_OBJ_VERTEX_DATA
129 eina_shutdown();
130} 128}
131 129
132static inline void 130static inline void