static void valuator_destroy(GF_Node *node, void *rs, Bool is_destroy) { if (is_destroy) { MFVec4f *stack = (MFVec4f *)gf_node_get_private(node); gf_sg_vrml_field_pointer_del(stack, GF_SG_VRML_MFROTATION); } }
void gf_isdec_del(GF_BaseDecoder *plug) { ISPriv *priv = (ISPriv *)plug->privateStack; gf_list_del(priv->is_nodes); while (gf_list_count(priv->ddf)) { GF_FieldInfo *fi = (GF_FieldInfo *)gf_list_get(priv->ddf, 0); gf_list_rem(priv->ddf, 0); gf_sg_vrml_field_pointer_del(fi->far_ptr, fi->fieldType); gf_free(fi); } gf_list_del(priv->ddf); gf_free(priv); gf_free(plug); }
void ISDec_Delete(GF_BaseDecoder *plug) { ISPriv *priv = (ISPriv *)plug->privateStack; gf_list_del(priv->is_nodes); while (gf_list_count(priv->ddf)) { GF_FieldInfo *fi = (GF_FieldInfo *)gf_list_get(priv->ddf, 0); gf_list_rem(priv->ddf, 0); gf_sg_vrml_field_pointer_del(fi->far_ptr, fi->fieldType); free(fi); } gf_list_del(priv->ddf); #if GPAC_HTK_DEMO gf_th_del(priv->th); #endif free(priv); free(plug); }
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); }