Commit 56f590a2 authored by Andrey Kleshchev's avatar Andrey Kleshchev Committed by NiranV

SL-13040 Fixed crash at EnvironmentPersistAcrossLogin

(cherry picked from commit d9783adb)
parent 62b9c6ae
......@@ -2844,7 +2844,7 @@ void LLEnvironment::loadSkyWaterFromSettings(const LLSD &env_data, bool &valid,
}
else if (env_data.has("sky_llsd"))
{
LLSettingsSky::ptr_t sky = std::make_shared<LLSettingsVOSky>(env_data["sky_llsd"]);
LLSettingsSky::ptr_t sky = LLSettingsVOSky::buildSky(env_data["sky_llsd"]);
setEnvironment(ENV_LOCAL, sky);
valid = true;
}
......@@ -2858,7 +2858,7 @@ void LLEnvironment::loadSkyWaterFromSettings(const LLSD &env_data, bool &valid,
}
else if (env_data.has("water_llsd"))
{
LLSettingsWater::ptr_t sky = std::make_shared<LLSettingsVOWater>(env_data["water_llsd"]);
LLSettingsWater::ptr_t sky = LLSettingsVOWater::buildWater(env_data["water_llsd"]);
setEnvironment(ENV_LOCAL, sky);
valid = true;
}
......@@ -2943,8 +2943,8 @@ bool LLEnvironment::loadFromSettings()
{
S32 length = env_data["day_length"].asInteger();
S32 offset = env_data["day_offset"].asInteger();
LLSettingsDay::ptr_t day = std::make_shared<LLSettingsVODay>(env_data["day_llsd"]);
setEnvironment(ENV_LOCAL, day, LLSettingsDay::Seconds(length), LLSettingsDay::Seconds(offset));
LLSettingsDay::ptr_t pday = LLSettingsVODay::buildDay(env_data["day_llsd"]);
setEnvironment(ENV_LOCAL, pday, LLSettingsDay::Seconds(length), LLSettingsDay::Seconds(offset));
valid = true;
}
......
......@@ -164,6 +164,9 @@ class LLSettingsVODay : public LLSettingsDay
public:
typedef std::function<void(LLSettingsDay::ptr_t day)> asset_built_fn;
// Todo: find a way to make this cnstructor private
// It shouldn't be used outside shared_prt and LLSettingsVODay
// outside of settings only use buildDay(settings)
LLSettingsVODay(const LLSD &data);
static ptr_t buildDay(LLSD settings);
......
......@@ -1978,8 +1978,7 @@ bool idle_startup()
set_startup_status(0.70f, LLTrans::getString("Misc"), "Initializing Initial Windows");
display_startup();
// Load stored local environment if needed. Only should be done once at least
// initial region data got loaded to avoid race condition with region's environment
// Load stored local environment if needed.
LLEnvironment::instance().loadFromSettings();
// *TODO : Uncomment that line once the whole grid migrated to SLM and suppress it from LLAgent::handleTeleportFinished() (llagent.cpp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment