1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-30 16:20:21 +00:00

Catch unhandled exceptions

This commit is contained in:
Andrei Kortunov 2023-07-31 15:58:39 +04:00
parent da06cd005e
commit deba5b4d47
3 changed files with 27 additions and 3 deletions

View File

@ -5,6 +5,7 @@
#include <extern/oics/ICSChannelListener.h> #include <extern/oics/ICSChannelListener.h>
#include <extern/oics/ICSInputControlSystem.h> #include <extern/oics/ICSInputControlSystem.h>
#include <components/debug/debuglog.hpp>
#include <components/files/conversion.hpp> #include <components/files/conversion.hpp>
#include <components/sdlutil/sdlmappings.hpp> #include <components/sdlutil/sdlmappings.hpp>
@ -193,7 +194,14 @@ namespace MWInput
BindingsManager::~BindingsManager() BindingsManager::~BindingsManager()
{ {
mInputBinder->save(Files::pathToUnicodeString(mUserFile)); try
{
mInputBinder->save(Files::pathToUnicodeString(mUserFile));
}
catch (std::exception& e)
{
Log(Debug::Error) << "Failed to save input bindings: " << e.what();
}
} }
void BindingsManager::update(float dt) void BindingsManager::update(float dt)

View File

@ -4,6 +4,7 @@
#include <apps/openmw/profile.hpp> #include <apps/openmw/profile.hpp>
#include <components/debug/debuglog.hpp>
#include <components/settings/values.hpp> #include <components/settings/values.hpp>
#include <osgViewer/Viewer> #include <osgViewer/Viewer>
@ -82,7 +83,14 @@ namespace MWLua
if (mJoinRequest) if (mJoinRequest)
break; break;
update(); try
{
update();
}
catch (std::exception& e)
{
Log(Debug::Error) << "Failed to update LuaManager: " << e.what();
}
mUpdateRequest = false; mUpdateRequest = false;
lk.unlock(); lk.unlock();

View File

@ -6,6 +6,7 @@
#include <osg/Group> #include <osg/Group>
#include <osg/PositionAttitudeTransform> #include <osg/PositionAttitudeTransform>
#include <components/debug/debuglog.hpp>
#include <components/esm3/loadpgrd.hpp> #include <components/esm3/loadpgrd.hpp>
#include <components/misc/coordinateconverter.hpp> #include <components/misc/coordinateconverter.hpp>
#include <components/resource/resourcesystem.hpp> #include <components/resource/resourcesystem.hpp>
@ -36,7 +37,14 @@ namespace MWRender
{ {
if (mPathgridEnabled) if (mPathgridEnabled)
{ {
togglePathgrid(); try
{
togglePathgrid();
}
catch (std::exception& e)
{
Log(Debug::Error) << "Failed to destroy pathgrid: " << e.what();
}
} }
} }