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->fc) free(elm->fc); elm->fc = NULL; if (elm->reso) free(elm->reso); if (elm->trempitch) free(elm->trempitch); if (elm->tremfc) free(elm->tremfc); if (elm->modpitch) free(elm->modpitch); if (elm->modfc) free(elm->modfc); elm->reso = 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->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; 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->fc) free(elm->fc); elm->fc = NULL; if (elm->reso) free(elm->reso); if (elm->trempitch) free(elm->trempitch); if (elm->tremfc) free(elm->tremfc); if (elm->modpitch) free(elm->modpitch); if (elm->modfc) free(elm->modfc); elm->reso = 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->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; 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();
int i, j; ToneBank *bank; ToneBankElement *elm;  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->sclnote) free(elm->sclnote); elm->sclnote = NULL; if (elm->scltune) free(elm->scltune); elm->scltune = NULL; if (elm->fc) free(elm->fc); elm->fc = NULL; if (elm->reso) free(elm->reso); if (elm->trempitch) free(elm->trempitch); if (elm->tremfc) free(elm->tremfc); if (elm->modpitch) free(elm->modpitch); if (elm->modfc) free(elm->modfc); elm->reso = 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->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; 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->sclnote) free(elm->sclnote); elm->sclnote = NULL; if (elm->scltune) free(elm->scltune); elm->scltune = NULL; if (elm->fc) free(elm->fc); elm->fc = NULL; if (elm->reso) free(elm->reso); if (elm->trempitch) free(elm->trempitch); if (elm->tremfc) free(elm->tremfc); if (elm->modpitch) free(elm->modpitch); if (elm->modfc) free(elm->modfc); elm->reso = 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->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; 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();
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->fc)		free(elm->fc);	elm->fc = NULL;	if (elm->reso)		free(elm->reso);	if (elm->trempitch)		free(elm->trempitch);	if (elm->tremfc)		free(elm->tremfc);	if (elm->modpitch)		free(elm->modpitch);	if (elm->modfc)		free(elm->modfc);	elm->reso = 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->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;	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->fc)		free(elm->fc);	elm->fc = NULL;	if (elm->reso)		free(elm->reso);	if (elm->trempitch)		free(elm->trempitch);	if (elm->tremfc)		free(elm->tremfc);	if (elm->modpitch)		free(elm->modpitch);	if (elm->modfc)		free(elm->modfc);	elm->reso = 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->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;	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();}