BASS_MusicFree

Frees a MOD music's resources, including any sync/DSP/FX it has.

BOOL BASS_MusicFree(
    HMUSIC handle
);

Parameters

handleThe MOD music handle.

Return value

If successful, TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_FREEINGThe MOD music is already being freed.

Remarks

MOD music freeing may be blocked by BASS_ChannelLock and BASS_ChannelRef. When that happens, the MOD music will be immediately stopped (if playing) and invalidated, but only freed when eventually unblocked by those functions; other function calls on it will fail with a BASS_ERROR_FREEING error. If the MOD music is locked to the current thread or its reference count is not 0, then the MOD music will be freed asynchronously (in another thread) once unblocked. The MOD music will also be freed asynchronously if this function is called from within a callback function where it would otherwise cause a crash.

See also

BASS_ChannelFree, BASS_ChannelRef