- if ((*type)->has_subtype == 1){
- ((s_smpi_subtype_t *)(*type)->substruct)->subtype_free(type);
- xbt_free((*type)->substruct);
+ if((*type)->attributes !=NULL){
+ xbt_dict_cursor_t cursor = NULL;
+ int* key;
+ void * value;
+ int flag;
+ xbt_dict_foreach((*type)->attributes, cursor, key, value){
+ smpi_type_key_elem elem =
+ static_cast<smpi_type_key_elem>(xbt_dict_get_or_null_ext(smpi_type_keyvals, (const char*)key, sizeof(int)));
+ if(elem && elem->delete_fn)
+ elem->delete_fn(*type,*key, value, &flag);
+ }