Clean temp files manually in mobile STK

This commit is contained in:
Benau
2020-02-03 09:39:43 +08:00
parent 00c7bf561e
commit db95d2f88f
4 changed files with 47 additions and 24 deletions

View File

@@ -130,19 +130,27 @@ float MainLoop::getLimitedDt()
if (first_out_focus)
{
first_out_focus = false;
music_manager->pauseMusic();
SFXManager::get()->pauseAll();
if (music_manager)
music_manager->pauseMusic();
if (SFXManager::get())
SFXManager::get()->pauseAll();
PlayerManager::get()->save();
if (addons_manager->hasDownloadedIcons())
addons_manager->saveInstalled();
// Clean temp files manually as destructor of file manager
// won't be called at all in mobile if user just press home
// button
file_manager->cleanTempFiles();
}
dev->run();
win_active = dev->isWindowActive();
has_focus = dev->isWindowFocused();
if (has_focus && win_active)
{
music_manager->resumeMusic();
SFXManager::get()->resumeAll();
if (music_manager)
music_manager->resumeMusic();
if (SFXManager::get())
SFXManager::get()->resumeAll();
// Improve rubber banding effects of rewinders when going
// back to phone, because the smooth timer is paused
if (World::getWorld() && RewindManager::isEnabled())