mirror of
https://github.com/love2d/love.git
synced 2026-08-20 20:49:54 +02:00
Fixed a memory leak in Sources created from SoundData.
This commit is contained in:
@@ -68,7 +68,10 @@ Source::Source(Pool *pool, love::sound::SoundData *soundData)
|
|||||||
, toLoop(0)
|
, toLoop(0)
|
||||||
{
|
{
|
||||||
ALenum fmt = getFormat(soundData->getChannels(), soundData->getBitDepth());
|
ALenum fmt = getFormat(soundData->getChannels(), soundData->getBitDepth());
|
||||||
staticBuffer = new StaticDataBuffer(fmt, soundData->getData(), soundData->getSize(), soundData->getSampleRate());
|
staticBuffer.set(new StaticDataBuffer(fmt, soundData->getData(), soundData->getSize(), soundData->getSampleRate()));
|
||||||
|
|
||||||
|
// The buffer has a +2 retain count right now, but we want it to have +1.
|
||||||
|
staticBuffer->release();
|
||||||
|
|
||||||
float z[3] = {0, 0, 0};
|
float z[3] = {0, 0, 0};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user