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

Fixed crash on changing cell due to Utf8Encoder going out of scope

This commit is contained in:
scrawl 2013-01-12 01:18:36 +01:00
parent 101810d1e8
commit ed3c23ad9a
2 changed files with 7 additions and 5 deletions

View file

@ -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)
MWGui::CursorReplace replacer;
// Create encoder
ToUTF8::Utf8Encoder encoder (mEncoding);
// Create the world
mEnvironment.setWorld (new MWWorld::World (*mOgre, mFileCollections, mMaster,
mResDir, mCfgMgr.getCachePath(), mNewGame, &encoder, mFallbackMap,
mResDir, mCfgMgr.getCachePath(), mNewGame, mEncoder, mFallbackMap,
mActivationDistanceOverride));
//Load translation data
mTranslationDataStorage.setEncoder(&encoder);
mTranslationDataStorage.setEncoder(mEncoder);
mTranslationDataStorage.loadTranslationData(mFileCollections, mMaster);
// Create window manager - this manages all the MW-specific GUI windows
@ -419,6 +416,10 @@ void OMW::Engine::go()
settingspath = loadSettings (settings);
// Create encoder
ToUTF8::Utf8Encoder encoder (mEncoding);
mEncoder = &encoder;
prepareEngine (settings);
// Play some good 'ol tunes

View file

@ -62,6 +62,7 @@ namespace OMW
{
MWBase::Environment mEnvironment;
ToUTF8::FromType mEncoding;
ToUTF8::Utf8Encoder* mEncoder;
Files::PathContainer mDataDirs;
boost::filesystem::path mResDir;
OEngine::Render::OgreRenderer *mOgre;