summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-07 16:27:45 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-07 16:27:45 +0200
commit3567d97406e28a2a22c7db47243cba8b13f5ce21 (patch)
tree74684a059a776042dd023720b68afeed6631c139
parent256180ac167996f6b9a395b010f0bbfae9c345a6 (diff)
Fix cover initialization
If catchers are called before evas_init, the related counters will always be 0. This is due to the infos list that was set to NULL during init.
-rw-r--r--src/lib/cov_preload.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/lib/cov_preload.c b/src/lib/cov_preload.c
index 3b5a0b5..75166ac 100644
--- a/src/lib/cov_preload.c
+++ b/src/lib/cov_preload.c
@@ -13,17 +13,24 @@ static Eina_Bool _exit_required = EINA_FALSE;
13 13
14Stat_Infos infos; 14Stat_Infos infos;
15 15
16EAPI int 16static void
17evas_init(void) 17_init()
18{ 18{
19 _init_count++; 19 static Eina_Bool _inited = EINA_FALSE;
20 int (*foo)() = dlsym(RTLD_NEXT, __func__); 20 if (!_inited)
21 if (_init_count == 1)
22 { 21 {
23 infos.l = NULL; 22 infos.l = NULL;
24 eina_init(); 23 eina_init();
25 eet_init(); 24 eet_init();
25 _inited = EINA_TRUE;
26 } 26 }
27}
28
29EAPI int
30evas_init(void)
31{
32 _init_count++;
33 int (*foo)() = dlsym(RTLD_NEXT, __func__);
27 return foo(); 34 return foo();
28} 35}
29 36
@@ -54,6 +61,7 @@ evas_shutdown()
54static Stat_Info * 61static Stat_Info *
55_info_update(const char *func, Stat_Info *info) 62_info_update(const char *func, Stat_Info *info)
56{ 63{
64 _init();
57 if (_exit_required) return info; 65 if (_exit_required) return info;
58 if (!info) 66 if (!info)
59 { 67 {