destroy_midi man page
destroy_midi — Destroys a MIDI structure when you are done with it. Allegro game programming library.
void destroy_midi(MIDI *midi);
Destroys a MIDI structure when you are done with it. It is safe to call this even when the MIDI file might be playing, because it checks and will kill it off if it is active. Use this to avoid memory leaks in your program.