In onNextFrame() I do cheking of free memory amount:
And I use following code to stop and free resources of old sound and load new to the same object:
But is seems that Sound::Free() not realease memory buffers, because free memory reduces every reload and finnaly program hangs up.
- Code:
MEMORYSTATUS memst;
memset( &memst;, 0, sizeof(MEMORYSTATUS) );
memst.dwLength = sizeof(MEMORYSTATUS);
GlobalMemoryStatus( &memst; );
pBackBuffer->drawFormattedText( 300, 10, Font::getSystemFontWithBorder(), Font::RIGHT_ALIGN, TEXT("Mem: %dKB"), memst.dwAvailPhys/1024 );
And I use following code to stop and free resources of old sound and load new to the same object:
- Code:
sndRoadLoop[0].stop();
sndRoadLoop[0].free();
sndRoadLoop[0].create( &soundFile;);
sndRoadLoop[0].play();
But is seems that Sound::Free() not realease memory buffers, because free memory reduces every reload and finnaly program hangs up.