Fix at-exit memory leak in digi_mixer

This commit is contained in:
Kp 2013-12-20 04:34:14 +00:00
parent fbf1f8a658
commit 1ec8057d74

View file

@ -46,10 +46,21 @@
#endif
#define MIN_VOLUME 10
struct RAIIMix_Chunk : public Mix_Chunk
{
~RAIIMix_Chunk()
{
#ifdef DEBUG_MEMORY_ALLOCATIONS
if (abuf)
#endif
d_free(abuf);
}
};
static int digi_initialised = 0;
static int digi_mixer_max_channels = MAX_SOUND_SLOTS;
static inline int fix2byte(fix f) { return (f / 256) % 256; }
Mix_Chunk SoundChunks[MAX_SOUNDS];
RAIIMix_Chunk SoundChunks[MAX_SOUNDS];
ubyte channels[MAX_SOUND_SLOTS];
/* Initialise audio */