remove redundant NULL checks in delete_fluid_synth()

This commit is contained in:
derselbst 2017-10-30 11:37:06 +01:00
parent 5427a4ebf5
commit 1da426dcfd

View file

@ -861,10 +861,8 @@ delete_fluid_synth(fluid_synth_t* synth)
/* also unset all presets for clean SoundFont unload */ /* also unset all presets for clean SoundFont unload */
if (synth->channel != NULL) if (synth->channel != NULL)
for (i = 0; i < synth->midi_channels; i++) for (i = 0; i < synth->midi_channels; i++)
if (synth->channel[i] != NULL)
fluid_channel_set_preset(synth->channel[i], NULL); fluid_channel_set_preset(synth->channel[i], NULL);
if (synth->eventhandler)
delete_fluid_rvoice_eventhandler(synth->eventhandler); delete_fluid_rvoice_eventhandler(synth->eventhandler);
/* delete all the SoundFonts */ /* delete all the SoundFonts */
@ -878,7 +876,7 @@ delete_fluid_synth(fluid_synth_t* synth)
/* Delete the SoundFont info hash */ /* Delete the SoundFont info hash */
if (synth->sfont_hash) delete_fluid_hashtable (synth->sfont_hash); delete_fluid_hashtable (synth->sfont_hash);
/* delete all the SoundFont loaders */ /* delete all the SoundFont loaders */
@ -893,18 +891,14 @@ delete_fluid_synth(fluid_synth_t* synth)
if (synth->channel != NULL) { if (synth->channel != NULL) {
for (i = 0; i < synth->midi_channels; i++) { for (i = 0; i < synth->midi_channels; i++) {
if (synth->channel[i] != NULL) {
delete_fluid_channel(synth->channel[i]); delete_fluid_channel(synth->channel[i]);
}
} }
FLUID_FREE(synth->channel); FLUID_FREE(synth->channel);
} }
if (synth->voice != NULL) { if (synth->voice != NULL) {
for (i = 0; i < synth->nvoice; i++) { for (i = 0; i < synth->nvoice; i++) {
if (synth->voice[i] != NULL) {
delete_fluid_voice(synth->voice[i]); delete_fluid_voice(synth->voice[i]);
}
} }
FLUID_FREE(synth->voice); FLUID_FREE(synth->voice);
} }
@ -915,9 +909,7 @@ delete_fluid_synth(fluid_synth_t* synth)
for (i = 0; i < 128; i++) { for (i = 0; i < 128; i++) {
if (synth->tuning[i] != NULL) { if (synth->tuning[i] != NULL) {
for (k = 0; k < 128; k++) { for (k = 0; k < 128; k++) {
if (synth->tuning[i][k] != NULL) {
delete_fluid_tuning(synth->tuning[i][k]); delete_fluid_tuning(synth->tuning[i][k]);
}
} }
FLUID_FREE(synth->tuning[i]); FLUID_FREE(synth->tuning[i]);
} }
@ -929,9 +921,7 @@ delete_fluid_synth(fluid_synth_t* synth)
#ifdef LADSPA #ifdef LADSPA
/* Release the LADSPA effects unit */ /* Release the LADSPA effects unit */
if (synth->ladspa_fx) {
delete_fluid_ladspa_fx(synth->ladspa_fx); delete_fluid_ladspa_fx(synth->ladspa_fx);
}
#endif #endif
/* delete all default modulators */ /* delete all default modulators */