summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-07-26 21:43:50 +0900
committerHermet Park <hermetpark@gmail.com>2018-07-26 21:43:50 +0900
commitbe33c835ac30fcf45d33bd65e932b05b43aab00d (patch)
tree74c29b4137474c1373c6fa0cf5bdf5300851fc14
parent67f50eb5d6f36c9d21dd7edc873bcc675227ca95 (diff)
evas: handle all failure cases with error messages in evas_init
Summary: fix T7026 Reviewers: Hermet Reviewed By: Hermet Subscribers: cedric, #committers Tags: #efl Maniphest Tasks: T7026 Differential Revision: https://phab.enlightenment.org/D6677
-rw-r--r--src/lib/evas/canvas/evas_main.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 389c5ce6dd..ec3c99c0d6 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -48,11 +48,13 @@ evas_init(void)
48 return --_evas_init_count; 48 return --_evas_init_count;
49#endif 49#endif
50 50
51 if (!eina_init()) 51 EINA_SAFETY_ON_FALSE_GOTO(eina_init(), shutdown_evil);
52 goto shutdown_evil;
53 52
54 if (!eet_init()) 53 EINA_SAFETY_ON_FALSE_GOTO(eet_init(), shutdown_eet);
55 goto shutdown_eet; 54#ifdef BUILD_LOADER_EET
55 /* additional init refcount; cannot fail */
56 eet_init();
57#endif
56 58
57 _evas_log_dom_global = eina_log_domain_register 59 _evas_log_dom_global = eina_log_domain_register
58 ("evas_main", EVAS_DEFAULT_LOG_COLOR); 60 ("evas_main", EVAS_DEFAULT_LOG_COLOR);
@@ -62,17 +64,12 @@ evas_init(void)
62 goto shutdown_eina; 64 goto shutdown_eina;
63 } 65 }
64 66
65 efl_object_init(); 67 EINA_SAFETY_ON_FALSE_GOTO(efl_object_init(), shutdown_eo);
66 68
67#ifdef BUILD_LOADER_EET 69 EINA_SAFETY_ON_FALSE_GOTO(ecore_init(), shutdown_ecore);
68 eet_init();
69#endif
70
71 ecore_init();
72 70
73 evas_module_init(); 71 evas_module_init();
74 if (!evas_async_events_init()) 72 EINA_SAFETY_ON_FALSE_GOTO(evas_async_events_init(), shutdown_module);
75 goto shutdown_module;
76#ifdef EVAS_CSERVE2 73#ifdef EVAS_CSERVE2
77 int cs2 = 0; 74 int cs2 = 0;
78 { 75 {
@@ -81,7 +78,7 @@ evas_init(void)
81 if (env && atoi(env)) 78 if (env && atoi(env))
82 { 79 {
83 cs2 = evas_cserve2_init(); 80 cs2 = evas_cserve2_init();
84 if (!cs2) goto shutdown_async_events; 81 EINA_SAFETY_ON_FALSE_GOTO(cs2, shutdown_async_events);
85 } 82 }
86 } 83 }
87#endif 84#endif
@@ -89,8 +86,7 @@ evas_init(void)
89 evas_filter_init(); 86 evas_filter_init();
90 evas_cache_vg_init(); 87 evas_cache_vg_init();
91 88
92 if (!evas_thread_init()) 89 EINA_SAFETY_ON_FALSE_GOTO(evas_thread_init(), shutdown_filter);
93 goto shutdown_filter;
94 90
95 evas_common_init(); 91 evas_common_init();
96 92
@@ -108,21 +104,23 @@ evas_init(void)
108 _evas_preload_thread_shutdown(); 104 _evas_preload_thread_shutdown();
109#ifdef EVAS_CSERVE2 105#ifdef EVAS_CSERVE2
110 if (cs2) evas_cserve2_shutdown(); 106 if (cs2) evas_cserve2_shutdown();
111 shutdown_async_events: 107shutdown_async_events:
112 evas_async_events_shutdown(); 108 evas_async_events_shutdown();
113#endif 109#endif
114 shutdown_module: 110shutdown_module:
115 evas_module_shutdown(); 111 evas_module_shutdown();
112shutdown_ecore:
113 efl_object_shutdown();
114shutdown_eo:
115 eina_log_domain_unregister(_evas_log_dom_global);
116shutdown_eet:
116#ifdef BUILD_LOADER_EET 117#ifdef BUILD_LOADER_EET
117 eet_shutdown(); 118 eet_shutdown();
118#endif 119#endif
119 efl_object_shutdown();
120 eina_log_domain_unregister(_evas_log_dom_global);
121 shutdown_eet:
122 eet_shutdown(); 120 eet_shutdown();
123 shutdown_eina: 121shutdown_eina:
124 eina_shutdown(); 122 eina_shutdown();
125 shutdown_evil: 123shutdown_evil:
126#ifdef _WIN32 124#ifdef _WIN32
127 evil_shutdown(); 125 evil_shutdown();
128#endif 126#endif