1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-13 15:09:43 +00:00

Destroy Engine after exception is logged

In cases where OpenMW throws an exception, then crashes in the Engine destructor (ideally should not happen, but keeps happening), we will at least see what the exception was about.
This commit is contained in:
scrawl 2014-07-26 22:29:04 +02:00
parent d7acb7fc7d
commit 47e42d4fda

View file

@ -309,6 +309,8 @@ int main(int argc, char**argv)
boost::filesystem::ofstream logfile;
std::auto_ptr<OMW::Engine> engine;
int ret = 0;
try
{
@ -350,11 +352,11 @@ int main(int argc, char**argv)
boost::filesystem::current_path(bundlePath);
#endif
OMW::Engine engine(cfgMgr);
engine.reset(new OMW::Engine(cfgMgr));
if (parseOptions(argc, argv, engine, cfgMgr))
if (parseOptions(argc, argv, *engine, cfgMgr))
{
engine.go();
engine->go();
}
}
catch (std::exception &e)