From 2379c0ada77f20c5fa1627f09492084db8335cf8 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 3 Sep 2014 04:54:07 +0200 Subject: [PATCH] Pause frame updates when the window is minimized (Fixes #1868) --- apps/openmw/engine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 21d0a2511..fa4c69337 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -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);