void gf_node_delete_attributes(GF_Node *node) { GF_DOMAttribute *tmp; GF_DOMAttribute *att = ((GF_DOMNode*)node)->attributes; while(att) { gf_svg_delete_attribute_value(att->data_type, att->data, node->sgprivate->scenegraph); tmp = att; att = att->next; if (tmp->tag==TAG_DOM_ATT_any) { gf_free( ((GF_DOMFullAttribute*)tmp)->name); } gf_free(tmp); } }
static void svg_delete_one_anim_value(u8 anim_datatype, void *anim_value, GF_SceneGraph *sg) { /* TODO: handle specific animation types : Motion, else ? */ gf_svg_delete_attribute_value(anim_datatype, anim_value, sg); }
GF_EXPORT void gf_sg_command_del(GF_Command *com) { u32 i; GF_Proto *proto; if (!com) return; if (com->tag < GF_SG_LAST_BIFS_COMMAND) { while (gf_list_count(com->command_fields)) { GF_CommandField *inf = (GF_CommandField *)gf_list_get(com->command_fields, 0); gf_list_rem(com->command_fields, 0); switch (inf->fieldType) { case GF_SG_VRML_SFNODE: if (inf->new_node) gf_node_unregister(inf->new_node, com->node); break; case GF_SG_VRML_MFNODE: if (inf->field_ptr) { GF_ChildNodeItem *cur, *child; child = inf->node_list; while (child) { cur = child; gf_node_unregister(child->node, com->node); child = child->next; free(cur); } } break; default: if (inf->field_ptr) gf_sg_vrml_field_pointer_del(inf->field_ptr, inf->fieldType); break; } free(inf); } } else { #ifndef GPAC_DISABLE_SVG while (gf_list_count(com->command_fields)) { GF_CommandField *inf = (GF_CommandField *)gf_list_get(com->command_fields, 0); gf_list_rem(com->command_fields, 0); if (inf->new_node) gf_node_unregister(inf->new_node, com->node); else if (inf->node_list) { gf_node_unregister_children(com->node, inf->node_list); } else if (inf->field_ptr) { gf_svg_delete_attribute_value(inf->fieldType, inf->field_ptr, com->in_scene); } free(inf); } #endif } gf_list_del(com->command_fields); i=0; while ((proto = (GF_Proto*)gf_list_enum(com->new_proto_list, &i))) { gf_sg_proto_del(proto); } gf_list_del(com->new_proto_list); if (com->node) { if (!com->in_scene) gf_node_unregister(com->node, NULL); else SG_CheckNodeUnregister(com); } if (com->del_proto_list) free(com->del_proto_list); if (com->def_name) free(com->def_name); if (com->scripts_to_load) gf_list_del(com->scripts_to_load); free(com); }