1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 09:23:53 +00:00

Merge branch 'hangup-fix' into 'master'

Fix hangup on savegame after manual screenshots.

See merge request OpenMW/openmw!905
This commit is contained in:
AnyOldName3 2021-05-24 17:57:39 +00:00
commit 4c4218f70d

View file

@ -61,6 +61,7 @@ namespace MWRender
void reset(unsigned int frame) void reset(unsigned int frame)
{ {
std::lock_guard<std::mutex> lock(mMutex);
mDone = false; mDone = false;
mFrame = frame; mFrame = frame;
} }
@ -104,11 +105,6 @@ namespace MWRender
, mResourceSystem(resourceSystem) , mResourceSystem(resourceSystem)
, mWater(water) , mWater(water)
{ {
// Note: This assumes no other final draw callbacks are set anywhere and that this callback will remain set until the application exits.
// This works around *DrawCallback manipulation being unsafe in OSG >= 3.5.10 for release 0.47
// If you need to set other final draw callbacks, read the comments of issue 6013 for a suggestion
// Ref https://gitlab.com/OpenMW/openmw/-/issues/6013
mViewer->getCamera()->setFinalDrawCallback(mDrawCompleteCallback);
} }
ScreenshotManager::~ScreenshotManager() ScreenshotManager::~ScreenshotManager()
@ -269,7 +265,10 @@ namespace MWRender
void ScreenshotManager::traversalsAndWait(unsigned int frame) void ScreenshotManager::traversalsAndWait(unsigned int frame)
{ {
// Ref https://gitlab.com/OpenMW/openmw/-/issues/6013
mDrawCompleteCallback->reset(frame); mDrawCompleteCallback->reset(frame);
mViewer->getCamera()->setFinalDrawCallback(mDrawCompleteCallback);
mViewer->eventTraversal(); mViewer->eventTraversal();
mViewer->updateTraversal(); mViewer->updateTraversal();
mViewer->renderingTraversals(); mViewer->renderingTraversals();