---
name: "destroy_midi"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/destroy_midi"
---

# destroy\_midi(3alleg)

Destroys a MIDI structure when you are done with it. Allegro game programming library.

## NAME

destroy\_midi - Destroys a MIDI structure when you are done with it. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**void destroy\_midi(MIDI \*midi);**

## DESCRIPTION

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.

## SEE ALSO

[**load\_midi**(3alleg)](/load_midi/3alleg.md), [**exmidi**(3alleg)](/exmidi/3alleg.md)
