evas: refcounting initialisation and protect things.
authorCedric BAIL <cedric@osg.samsung.com>
Fri, 20 Feb 2015 14:10:12 +0000 (15:10 +0100)
committerCedric BAIL <cedric@osg.samsung.com>
Fri, 20 Feb 2015 14:10:12 +0000 (15:10 +0100)
src/lib/evas/common/evas_draw_main.c

index 570220b..5d1e415 100644 (file)
@@ -32,9 +32,13 @@ evas_common_draw_context_cutouts_del(Cutout_Rects* rects, int idx)
      }
 }
 
+static int _init_count = 0;
+
 EAPI void
 evas_common_init(void)
 {
+   if (_init_count++) return ;
+
    evas_common_cpu_init();
 
    evas_common_blend_init();
@@ -52,6 +56,8 @@ evas_common_init(void)
 EAPI void
 evas_common_shutdown(void)
 {
+   if (--_init_count) return ;
+
    evas_font_dir_cache_free();
    evas_common_image_cache_free();
 }