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:
parent
d7acb7fc7d
commit
47e42d4fda
1 changed files with 5 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue