0
0

Hi,

I’m using fmod version 4.07.05 of fmodex on windows.

I’m creating an fmod sound, like this:

[code:3pzjd52j]
FMOD_RESULT result;
FMOD_SOUND* ptFModSound = NULL;
FMOD_CREATESOUNDEXINFO exinfo;
FMOD_MODE dwMode = FMOD_SOFTWARE | FMOD_CREATESTREAM | FMOD_LOOP_NORMAL | FMOD_OPENUSER;

MEMCLEAR(&exinfo, sizeof(exinfo));

assert(dwBitRate == 16);

exinfo.cbsize = sizeof(exinfo);
exinfo.defaultfrequency = 44100;
exinfo.numchannels = 1;
exinfo.numsubsounds = 2;
exinfo.format = FMOD_SOUND_FORMAT_PCM16;

result = FMOD_System_CreateSound( sFModSoundGlobals.ptFModSystem, NULL, dwMode, &exinfo, &ptFModSound );
[/code:3pzjd52j]

Then later, I’ll create a sound sentence and add some sub sounds using these calls:

[code:3pzjd52j]
FMOD_Sound_SetSubSound(...)
FMOD_Sound_SetSubSound(...)
[/code:3pzjd52j]

and finally:

[code:3pzjd52j]
int soundlist[2] = { 0, 1 };

result = FMOD_Sound_SetSubSoundSentence(ptFModSound, soundlist, 2);
[/code:3pzjd52j]

Finally, believe it or not, I play the sound. And then, sadly, it’s time to close my app, and so the sound must stop and I eventually have to call down to FMOD_Sound_Release().

The issue is that when I do this, FMOD ends up leaking 248 bytes of memory that is allocated during the call to FMOD_System_CreateSound().

I haven’t done this in an example because it’s not convenient to take my memory tracking system into the examples, but I’ve done some detective work and am hoping that you fmod guys can give me a hand.

In the call to FMOD_System_CreateSound(), fmod makes the following allocations:

1) 436 bytes
2) 2064 bytes
3) 528 bytes
4) 24 bytes
5) 248 bytes
6) 272 bytes
7) 296 bytes
8) 70,608 bytes
9) 272 bytes
10) 180 bytes
11) 248 bytes
12) 24 bytes

When I call FMOD_Sound_Release() on my sound, the return value is FMOD_OK, and all of the allocations above are freed except for allocation #11.

Is this a legitimate bug, or am I not cleaning something else up properly? Any help would be greatly appreciated.

thanks,
sam

  • You must to post comments
0
0

Hi,
I’ve fixed this for the next release.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.