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:
parent
ed94db3e18
commit
41587d61ee
1 changed files with 2 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue