1
0
Fork 0

A reinit of the FGFX class left all the previous samples in the sample group in a stale state. The sample group code is robust enough to handle such a situation but they still occupy memory. So stop the inherited sample group explicityly at reinit to free the samples.

This commit is contained in:
Erik Hofman 2021-01-23 12:01:47 +01:00
parent ed94db3e18
commit 41587d61ee

View file

@ -159,9 +159,11 @@ FGFX::init()
void
FGFX::reinit()
{
SGSampleGroup::stop();
std::for_each(_sound.begin(), _sound.end(), [](const SGXmlSound* snd) { delete snd; });
_sound.clear();
init();
SGSampleGroup::resume();
}