diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-04-15 19:36:37 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-04-20 22:03:06 +0300 |
commit | d9783adba73cce9a68fde4ba0ba78add28da4279 (patch) | |
tree | b68ec0cfd333cacc646954a9939df8ebc13e4731 | |
parent | c757c29c95f60b174903ced0a9ef9ea352d3bb2f (diff) |
SL-13040 Fixed crash at EnvironmentPersistAcrossLogin
-rw-r--r-- | indra/newview/llenvironment.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llsettingsvo.h | 3 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 3 |
3 files changed, 8 insertions, 6 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 0e1c4f9434..342ee3ccf5 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -2800,7 +2800,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; } @@ -2814,7 +2814,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; } @@ -2899,8 +2899,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; } diff --git a/indra/newview/llsettingsvo.h b/indra/newview/llsettingsvo.h index 1f29013ecf..65136ad2f5 100644 --- a/indra/newview/llsettingsvo.h +++ b/indra/newview/llsettingsvo.h @@ -158,6 +158,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); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index a1d1e85492..7673bae725 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1879,8 +1879,7 @@ bool idle_startup() 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) |