wl_list_for_each_safe(ctrlsurf, next,
&shell->list_controller_surface, link) {
- if (id_surface != ctrlsurf->id_surface) {
+
+ if (resource != ctrlsurf->resource) {
continue;
}
+
wl_list_remove(&ctrlsurf->link);
free(ctrlsurf);
ctrlsurf = NULL;
wl_list_for_each_safe(ctrllayer, next,
&shell->list_controller_layer, link) {
- if (id_layer != ctrllayer->id_layer) {
+
+ if (resource != ctrllayer->resource) {
continue;
}
continue;
}
#endif
+
+ if (resource != ctrlscrn->resource) {
+ continue;
+ }
+
wl_list_remove(&ctrlscrn->link);
free(ctrlscrn);
ctrlscrn = NULL;
struct ivisurface *ivisurf = wl_resource_get_user_data(resource);
struct ivishell *shell = ivisurf->shell;
struct ivicontroller_surface *ctrlsurf = NULL;
+ struct ivicontroller_surface *next = NULL;
uint32_t id_surface = weston_layout_getIdOfSurface(ivisurf->layout_surface);
(void)client;
(void)destroy_scene_object;
- wl_list_for_each(ctrlsurf, &shell->list_controller_surface, link) {
- if (ctrlsurf->id_surface != id_surface) {
+ wl_list_for_each_safe(ctrlsurf, next,
+ &shell->list_controller_surface, link) {
+ if (ctrlsurf->resource != resource) {
continue;
}
if (!wl_list_empty(&ctrlsurf->link)) {
wl_list_remove(&ctrlsurf->link);
}
+ free(ctrlsurf);
wl_resource_destroy(resource);
break;
}
if (!wl_list_empty(&ctrllayer->link)) {
wl_list_remove(&ctrllayer->link);
}
+ free(ctrllayer);
wl_resource_destroy(resource);
break;
}
wl_list_for_each_safe(ctrlscrn, next,
&iviscrn->shell->list_controller_screen, link) {
-// TODO : Only Single display
- destroy_ivicontroller_screen(ctrlscrn->resource);
+ if (resource != ctrlscrn->resource) {
+ continue;
+ }
+
+ wl_list_remove(&ctrlscrn->link);
+ free(ctrlscrn);
+ ctrlscrn = NULL;
wl_resource_destroy(ctrlscrn->resource);
break;
}