if (elm->modenvrate) free_ptr_list(elm->modenvrate, elm->modenvratenum); elm->modenvrate = NULL; elm->modenvratenum = 0; if (elm->modenvofs) free_ptr_list(elm->modenvofs, elm->modenvofsnum); elm->modenvofs = NULL; elm->modenvofsnum = 0;
MAIN_INTERFACE void tmdy_free_config(void){  ToneBank *bank;  ToneBankElement *elm;  int i, j;  for (i = 0; i < 128; i++) {    bank = tonebank[i];    if (!bank)      continue;    for (j = 0; j < 128; j++) {      elm = &bank->tone[j];      if (elm->name)	free(elm->name);	elm->name = NULL;      if (elm->comment)	free(elm->comment);	elm->comment = NULL;	if (elm->tune)		free(elm->tune);	elm->tune = NULL;	if (elm->envrate)		free_ptr_list(elm->envrate, elm->envratenum);	elm->envrate = NULL;	elm->envratenum = 0;	if (elm->envofs)		free_ptr_list(elm->envofs, elm->envofsnum);	elm->envofs = NULL;	elm->envofsnum = 0;	if (elm->trem)		free_ptr_list(elm->trem, elm->tremnum);	elm->trem = NULL;	elm->tremnum = 0;	if (elm->vib)		free_ptr_list(elm->vib, elm->vibnum);	elm->vib = NULL;	elm->vibnum = 0;	elm->instype = 0;    }    if (i > 0) {      free(bank);      tonebank[i] = NULL;    }  }  for (i = 0; i < 128; i++) {    bank = drumset[i];    if (!bank)      continue;    for (j = 0; j < 128; j++) {      elm = &bank->tone[j];      if (elm->name)	free(elm->name);	elm->name = NULL;      if (elm->comment)	free(elm->comment);	elm->comment = NULL;	if (elm->tune)		free(elm->tune);	elm->tune = NULL;	if (elm->envrate)		free_ptr_list(elm->envrate, elm->envratenum);	elm->envrate = NULL;	elm->envratenum = 0;	if (elm->envofs)		free_ptr_list(elm->envofs, elm->envofsnum);	elm->envofs = NULL;	elm->envofsnum = 0;	if (elm->trem)		free_ptr_list(elm->trem, elm->tremnum);	elm->trem = NULL;	elm->tremnum = 0;	if (elm->vib)		free_ptr_list(elm->vib, elm->vibnum);	elm->vib = NULL;	elm->vibnum = 0;	elm->instype = 0;    }    if (i > 0) {      free(bank);      drumset[i] = NULL;    }  }  free_instrument_map();  clean_up_pathlist();}