1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:19:56 +00:00

Fix not reacting to quit request while video is playing

This commit is contained in:
scrawl 2014-06-05 15:39:08 +02:00
parent c0f1449004
commit cefa20bfb9
3 changed files with 10 additions and 1 deletions

View file

@ -42,4 +42,9 @@ bool VideoWidget::update()
return mPlayer.isPlaying(); return mPlayer.isPlaying();
} }
void VideoWidget::cleanup()
{
mPlayer.close();
}
} }

View file

@ -26,6 +26,9 @@ namespace MWGui
/// @return Is the video still playing? /// @return Is the video still playing?
bool update(); bool update();
/// Free video player resources (done automatically on destruction)
void cleanup();
private: private:
bool mAllowSkipping; bool mAllowSkipping;

View file

@ -1576,12 +1576,13 @@ namespace MWGui
bool cursorWasVisible = mCursorVisible; bool cursorWasVisible = mCursorVisible;
setCursorVisible(false); setCursorVisible(false);
while (mVideoWidget->update()) while (mVideoWidget->update() && !MWBase::Environment::get().getStateManager()->hasQuitRequest())
{ {
MWBase::Environment::get().getInputManager()->update(0, true, false); MWBase::Environment::get().getInputManager()->update(0, true, false);
mRendering->getWindow()->update(); mRendering->getWindow()->update();
} }
mVideoWidget->cleanup();
setCursorVisible(cursorWasVisible); setCursorVisible(cursorWasVisible);