mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-01 00:55:06 +01:00
- fix game/banner sound sometimes memory leak. now properly clearing game/banner sound from memory.
- fix for gc banner sound options previously added to page 11
This commit is contained in:
parent
ab4c6a3ceb
commit
2280abdd29
BIN
out/boot.dol
BIN
out/boot.dol
Binary file not shown.
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 3.3 MiB |
@ -276,11 +276,13 @@ int CMenu::_config7(int curPage)
|
||||
{
|
||||
m_cfg.setBool(GC_DOMAIN, "play_banner_sound", !m_cfg.getBool(GC_DOMAIN, "play_banner_sound"));
|
||||
m_btnMgr.setText(m_config7Btn3, m_cfg.getBool(GC_DOMAIN, "play_banner_sound") ? _t("yes", L"Yes") : _t("no", L"No"));
|
||||
m_gc_play_banner_sound = m_cfg.getBool(GC_DOMAIN, "play_banner_sound", true);
|
||||
}
|
||||
else if(m_btnMgr.selected(m_config7Btn4))
|
||||
{
|
||||
m_cfg.setBool(GC_DOMAIN, "play_default_sound", !m_cfg.getBool(GC_DOMAIN, "play_default_sound"));
|
||||
m_btnMgr.setText(m_config7Btn4, m_cfg.getBool(GC_DOMAIN, "play_default_sound") ? _t("yes", L"Yes") : _t("no", L"No"));
|
||||
m_gc_play_default_sound = m_cfg.getBool(GC_DOMAIN, "play_default_sound", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2310,7 +2310,7 @@ void * CMenu::_gameSoundThread(void *obj)
|
||||
//get sound from wii, channel, or custom banner and load it to play with the banner
|
||||
u32 sndSize = 0;
|
||||
u8 *soundBin = CurrentBanner.GetFile("sound.bin", &sndSize);
|
||||
CurrentBanner.ClearBanner();
|
||||
CurrentBanner.ClearBanner();// got sound.bin and banner for displaying is loaded so no longer need current banner.
|
||||
|
||||
if(soundBin != NULL && (GameHdr->type != TYPE_GC_GAME || m->m_gc_play_banner_sound))
|
||||
{
|
||||
@ -2318,11 +2318,11 @@ void * CMenu::_gameSoundThread(void *obj)
|
||||
{
|
||||
u32 newSize = 0;
|
||||
u8 *newSound = DecompressCopy(soundBin, sndSize, &newSize);
|
||||
free(soundBin);// no longer needed, now using decompressed newSound
|
||||
if(newSound == NULL || newSize == 0 || !m->m_gameSound.Load(newSound, newSize))
|
||||
{
|
||||
free(soundBin);
|
||||
m->m_gameSound.FreeMemory();
|
||||
m_banner.DeleteBanner();
|
||||
m->m_gameSound.FreeMemory();// frees newSound
|
||||
m_banner.DeleteBanner();// the same as UnloadBanner
|
||||
m->m_soundThrdBusy = false;
|
||||
return NULL;
|
||||
}
|
||||
@ -2334,15 +2334,17 @@ void * CMenu::_gameSoundThread(void *obj)
|
||||
m->m_gamesound_changed = true;
|
||||
else
|
||||
{
|
||||
m->m_gameSound.FreeMemory();
|
||||
m->m_gameSound.FreeMemory();// frees soundBin
|
||||
m_banner.DeleteBanner();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gprintf("WARNING: No sound found in banner!\n");
|
||||
if(soundBin != NULL)
|
||||
free(soundBin);
|
||||
//gprintf("WARNING: No sound found in banner!\n");
|
||||
m->m_gamesound_changed = true;
|
||||
m->m_gameSound.FreeMemory();
|
||||
m->m_gameSound.FreeMemory();// frees previous game sound
|
||||
}
|
||||
m->m_soundThrdBusy = false;
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user