void lst_free(lui_list *lst) { if(!lst) return; if(lst->ia) iarea_free(lst->ia); if(lst->up) iarea_free(lst->up); if(lst->down) iarea_free(lst->down); if(lst->view) view_free(lst->view); if(lst->bg) SDL_FreeSurface(lst->bg); if(lst->upclick) view_free(lst->upclick); if(lst->downclick) view_free(lst->downclick); if(lst->name) free(lst->name); free(lst); }
static void remove_pixel_display (ply_boot_splash_plugin_t *plugin, ply_pixel_display_t *display) { ply_list_node_t *node; node = ply_list_get_first_node (plugin->views); while (node != NULL) { view_t *view; ply_list_node_t *next_node; view = ply_list_node_get_data (node); next_node = ply_list_get_next_node (plugin->views, node); if (view->display == display) { ply_pixel_display_set_draw_handler (view->display, NULL, NULL); view_free (view); ply_list_remove_node (plugin->views, node); return; } node = next_node; } }
static void window_free(Win *win) { if (!win) return; Editor *ed = win->editor; if (ed && ed->ui) ed->ui->window_free(win->ui); view_free(win->view); ringbuf_free(win->jumplist); free(win); }
void app_free(struct app *app) { if (!app) return; for (int i = 0; i < app->views_count; ++i) { view_free(app->views[i]); } free_or_die(app->views); free_or_die(app); }
static void apply_delta(detector_t* d, view_t* view) { deltamap_t* map = view->delta; if(map == NULL) return; // update refs with delta size_t i = HASHMAP_BEGIN; delta_t* delta; while((delta = ponyint_deltamap_next(map, &i)) != NULL) { // If rc is 0, we skip creating a view for the actor. pony_actor_t* actor = ponyint_delta_actor(delta); size_t rc = ponyint_delta_rc(delta); // If the referenced actor has never blocked, we will insert a view_t // that has blocked set to false. view_t* find = get_view(d, actor, rc > 0); if(find == NULL) continue; viewref_t key; key.view = find; if(rc > 0) { viewref_t* ref = ponyint_viewrefmap_get(&view->map, &key); if(ref == NULL) { ref = (viewref_t*)POOL_ALLOC(viewref_t); ref->view = find; ponyint_viewrefmap_put(&view->map, ref); find->view_rc++; } ref->rc = rc; } else { viewref_t* ref = ponyint_viewrefmap_remove(&view->map, &key); if(ref != NULL) { viewref_free(ref); view_free(find); } } } ponyint_deltamap_free(map); view->delta = NULL; }
static void window_free(Win *win) { if (!win) return; Vis *vis = win->vis; for (Win *other = vis->windows; other; other = other->next) { if (other->parent == win) other->parent = NULL; } if (vis->ui) vis->ui->window_free(win->ui); view_free(win->view); for (size_t i = 0; i < LENGTH(win->modes); i++) map_free(win->modes[i].bindings); ringbuf_free(win->jumplist); free(win); }
static void add_pixel_display (ply_boot_splash_plugin_t *plugin, ply_pixel_display_t *display) { view_t *view; ply_trace ("adding pixel display to plugin"); view = view_new (plugin, display); ply_pixel_display_set_draw_handler (view->display, (ply_pixel_display_draw_handler_t) on_draw, view); if (plugin->is_visible) { if (view_load (view)) ply_list_append_data (plugin->views, view); else view_free (view); } else { ply_list_append_data (plugin->views, view); } }
static void free_views (ply_boot_splash_plugin_t *plugin) { ply_list_node_t *node; node = ply_list_get_first_node (plugin->views); while (node != NULL) { ply_list_node_t *next_node; view_t *view; view = ply_list_node_get_data (node); next_node = ply_list_get_next_node (plugin->views, node); view_free (view); ply_list_remove_node (plugin->views, node); node = next_node; } ply_list_free (plugin->views); plugin->views = NULL; }