1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

Pause frame updates when the window is minimized (Fixes #1868)

This commit is contained in:
scrawl 2014-09-03 04:54:07 +02:00
parent 24e5a90bab
commit 2379c0ada7

View File

@ -86,6 +86,11 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
// update input
MWBase::Environment::get().getInputManager()->update(frametime, false);
// When the window is minimized, pause everything. Currently this *has* to be here to work around a MyGUI bug.
// If we are not currently rendering, then RenderItems will not be reused resulting in a memory leak upon changing widget textures.
if (!mOgre->getWindow()->isActive() || !mOgre->getWindow()->isVisible())
return true;
// sound
if (mUseSound)
MWBase::Environment::get().getSoundManager()->update(frametime);