mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 08:39:42 +00:00
Fixed crash on changing cell due to Utf8Encoder going out of scope
This commit is contained in:
parent
101810d1e8
commit
ed3c23ad9a
2 changed files with 7 additions and 5 deletions
|
@ -325,16 +325,13 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
||||||
// cursor replacer (converts the cursor from the bsa so they can be used by mygui)
|
// cursor replacer (converts the cursor from the bsa so they can be used by mygui)
|
||||||
MWGui::CursorReplace replacer;
|
MWGui::CursorReplace replacer;
|
||||||
|
|
||||||
// Create encoder
|
|
||||||
ToUTF8::Utf8Encoder encoder (mEncoding);
|
|
||||||
|
|
||||||
// Create the world
|
// Create the world
|
||||||
mEnvironment.setWorld (new MWWorld::World (*mOgre, mFileCollections, mMaster,
|
mEnvironment.setWorld (new MWWorld::World (*mOgre, mFileCollections, mMaster,
|
||||||
mResDir, mCfgMgr.getCachePath(), mNewGame, &encoder, mFallbackMap,
|
mResDir, mCfgMgr.getCachePath(), mNewGame, mEncoder, mFallbackMap,
|
||||||
mActivationDistanceOverride));
|
mActivationDistanceOverride));
|
||||||
|
|
||||||
//Load translation data
|
//Load translation data
|
||||||
mTranslationDataStorage.setEncoder(&encoder);
|
mTranslationDataStorage.setEncoder(mEncoder);
|
||||||
mTranslationDataStorage.loadTranslationData(mFileCollections, mMaster);
|
mTranslationDataStorage.loadTranslationData(mFileCollections, mMaster);
|
||||||
|
|
||||||
// Create window manager - this manages all the MW-specific GUI windows
|
// Create window manager - this manages all the MW-specific GUI windows
|
||||||
|
@ -419,6 +416,10 @@ void OMW::Engine::go()
|
||||||
|
|
||||||
settingspath = loadSettings (settings);
|
settingspath = loadSettings (settings);
|
||||||
|
|
||||||
|
// Create encoder
|
||||||
|
ToUTF8::Utf8Encoder encoder (mEncoding);
|
||||||
|
mEncoder = &encoder;
|
||||||
|
|
||||||
prepareEngine (settings);
|
prepareEngine (settings);
|
||||||
|
|
||||||
// Play some good 'ol tunes
|
// Play some good 'ol tunes
|
||||||
|
|
|
@ -62,6 +62,7 @@ namespace OMW
|
||||||
{
|
{
|
||||||
MWBase::Environment mEnvironment;
|
MWBase::Environment mEnvironment;
|
||||||
ToUTF8::FromType mEncoding;
|
ToUTF8::FromType mEncoding;
|
||||||
|
ToUTF8::Utf8Encoder* mEncoder;
|
||||||
Files::PathContainer mDataDirs;
|
Files::PathContainer mDataDirs;
|
||||||
boost::filesystem::path mResDir;
|
boost::filesystem::path mResDir;
|
||||||
OEngine::Render::OgreRenderer *mOgre;
|
OEngine::Render::OgreRenderer *mOgre;
|
||||||
|
|
Loading…
Reference in a new issue