tizen_policy: no need to save resources and destroy it. 41/241241/2
authorSeunghun Lee <shiin.lee@samsung.com>
Fri, 31 Jul 2020 16:35:07 +0000 (01:35 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Wed, 19 Aug 2020 16:45:12 +0000 (01:45 +0900)
all wl_resources associated with wl_client is destroyed when
wl_client_destroy is processed.

Change-Id: Ic8661f5c78e611e156be903d29c523a51b51f4ff

src/lib/extensions/tizen_policy.c

index 40721ff8378fd095af73a8576fd2975756071f1a..4bed7e170afcfde8557ec356303b172c516232b4 100644 (file)
@@ -14,7 +14,6 @@ typedef struct
 
 const static char       *tsurf_data_key = "tzpol-surf";
 static struct wl_global *_tzpol_global = NULL;
-static struct wl_list    _tzpol_res_list;
 
 static void
 _tzpol_surface_del(tzpol_surface_t *tsurf)
@@ -641,12 +640,6 @@ static const struct tizen_policy_interface _tzpol_iface =
    _tzpol_iface_cb_set_appid,
 };
 
-static void
-_tzpol_cb_unbind(struct wl_resource *resource)
-{
-   wl_list_remove(wl_resource_get_link(resource));
-}
-
 static void
 _tzpol_cb_bind(struct wl_client *client, void *data, uint32_t ver, uint32_t id)
 {
@@ -662,9 +655,7 @@ _tzpol_cb_bind(struct wl_client *client, void *data, uint32_t ver, uint32_t id)
         return;
      }
 
-   wl_resource_set_implementation(resource, &_tzpol_iface, NULL, _tzpol_cb_unbind);
-
-   wl_list_insert(&_tzpol_res_list, wl_resource_get_link(resource));
+   wl_resource_set_implementation(resource, &_tzpol_iface, NULL, NULL);
 }
 
 Eina_Bool
@@ -677,8 +668,6 @@ tizen_policy_init(pepper_efl_comp_t *comp)
    if (_tzpol_global)
      goto end;
 
-   wl_list_init(&_tzpol_res_list);
-
    wl_disp = pepper_compositor_get_display(comp->pepper.comp);
    _tzpol_global = wl_global_create(wl_disp, &tizen_policy_interface, 7, NULL, _tzpol_cb_bind);
    if (!_tzpol_global)
@@ -693,13 +682,8 @@ end:
 void
 tizen_policy_shutdown(void)
 {
-   struct wl_resource *res, *tmp;
-
    DBG("tizen_policy::shutdown");
 
-   wl_resource_for_each_safe(res, tmp, &_tzpol_res_list)
-      wl_resource_destroy(res);
-
    wl_global_destroy(_tzpol_global);
    _tzpol_global = NULL;
 }