Remove return "refenceres to temporary" and instead return a copy.

master
Nicky Dasmijn 2020-07-20 12:15:54 +02:00
parent a382089940
commit df242c1d46
2 changed files with 3 additions and 3 deletions

View File

@ -558,7 +558,7 @@ ERlvCmdRet RlvEnvironment::handleSetFn(const std::string& strRlvOption, const st
}
template<>
std::string RlvEnvironment::handleLegacyGetFn<LLVector2>(const std::function<const LLVector2& (LLSettingsSkyPtr_t)>& getFn, U32 idxComponent)
std::string RlvEnvironment::handleLegacyGetFn<LLVector2>(const std::function<LLVector2 (LLSettingsSkyPtr_t)>& getFn, U32 idxComponent)
{
if (idxComponent > 2)
return LLStringUtil::null;
@ -566,7 +566,7 @@ std::string RlvEnvironment::handleLegacyGetFn<LLVector2>(const std::function<con
}
template<>
std::string RlvEnvironment::handleLegacyGetFn<LLColor3>(const std::function<const LLColor3& (LLSettingsSkyPtr_t)>& getFn, U32 idxComponent)
std::string RlvEnvironment::handleLegacyGetFn<LLColor3>(const std::function<LLColor3 (LLSettingsSkyPtr_t)>& getFn, U32 idxComponent)
{
if ( (idxComponent >= VRED) && (idxComponent <= VBLUE) )
{

View File

@ -50,7 +50,7 @@ protected:
// Command handling helpers
template<typename T> std::string handleGetFn(const std::function<T(LLSettingsSky::ptr_t)>& fn);
template<typename T> ERlvCmdRet handleSetFn(const std::string& strRlvOption, const std::function<void(LLSettingsSky::ptr_t, const T&)>& fn);
template<typename T> std::string handleLegacyGetFn(const std::function<const T& (LLSettingsSky::ptr_t)>& getFn, U32 idxComponent);
template<typename T> std::string handleLegacyGetFn(const std::function< T (LLSettingsSky::ptr_t)>& getFn, U32 idxComponent);
template<typename T> ERlvCmdRet handleLegacySetFn(float optionValue, T value, const std::function<void(LLSettingsSky::ptr_t, const T&)>& setFn, U32 idxComponent);
/*