ecore-wl2: Add API function for ecore_wl2_shutdown
authorChris Michael <cp.michael@samsung.com>
Tue, 18 Aug 2015 14:15:01 +0000 (10:15 -0400)
committerChris Michael <cp.michael@samsung.com>
Thu, 3 Dec 2015 17:02:40 +0000 (12:02 -0500)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_wl2/ecore_wl2.c

index 8943f81..5b643fb 100644 (file)
@@ -66,3 +66,34 @@ eina_err:
    eina_shutdown();
    return --_ecore_wl2_init_count;
 }
+
+EAPI int
+ecore_wl2_shutdown(void)
+{
+   if (_ecore_wl2_init_count < 1)
+     {
+        ERR("Ecore_Wl2 shutdown called without Ecore_Wl2 Init");
+        return 0;
+     }
+
+   if (--_ecore_wl2_init_count != 0) return _ecore_wl2_init_count;
+
+   /* reset events */
+   ECORE_WL2_EVENT_GLOBAL_ADDED = 0;
+   ECORE_WL2_EVENT_GLOBAL_REMOVED = 0;
+
+   /* shutdown Ecore_Event */
+   ecore_event_shutdown();
+
+   /* shutdown Ecore */
+   ecore_shutdown();
+
+   /* unregister logging domain */
+   eina_log_domain_unregister(_ecore_wl2_log_dom);
+   _ecore_wl2_log_dom = -1;
+
+   /* shutdown eina */
+   eina_shutdown();
+
+   return _ecore_wl2_init_count;
+}