e_dpms: manage dpms wayland global resource 20/206920/3
authorJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 29 May 2019 04:35:02 +0000 (13:35 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 30 May 2019 01:38:07 +0000 (01:38 +0000)
Change-Id: I51097463e41d9bd4108273f4aab97641036c478d
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/bin/e_dpms.c

index e59ada0..972056e 100644 (file)
@@ -31,6 +31,7 @@ Ecore_Event_Handler *dbus_init_done_handler = NULL;
 static Eldbus_Service_Interface *iface;
 
 static Eina_List *dpms_list;
+static struct wl_global *dpms_global;
 
 typedef struct _E_Dpms
 {
@@ -306,8 +307,10 @@ e_dpms_init(void)
      }
 
    /* try to add dpms_manager to wayland globals */
-   if (!wl_global_create(e_comp_wl->wl.disp, &tizen_dpms_manager_interface, 1,
-                         NULL, _e_dpms_cb_bind))
+   dpms_global = wl_global_create(e_comp_wl->wl.disp,
+                                  &tizen_dpms_manager_interface, 1, NULL,
+                                  _e_dpms_cb_bind);
+   if (!dpms_global)
      ERR("Could not add tizen_dpms_manager to wayland globals");
 
    return 1;
@@ -319,6 +322,12 @@ e_dpms_shutdown(void)
    E_Dpms *dpms = NULL;
    Eina_List *l;
 
+   if (dpms_global)
+     {
+        wl_global_destroy(dpms_global);
+        dpms_global = NULL;
+     }
+
    if (dbus_init_done_handler)
      {
         ecore_event_handler_del(dbus_init_done_handler);