Fixed memory stomping leading to Track View nodes with invalid labels and crash.
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
This commit is contained in:
@@ -150,16 +150,16 @@ private:
|
||||
}
|
||||
BehaviorPropertyInfo(const BehaviorPropertyInfo& other)
|
||||
{
|
||||
m_displayName = other.m_displayName;
|
||||
m_animNodeParamInfo.paramType = other.m_displayName;
|
||||
m_animNodeParamInfo.name = &m_displayName[0];
|
||||
m_displayName = AZStd::move(other.m_displayName);
|
||||
m_animNodeParamInfo.paramType = m_displayName;
|
||||
m_animNodeParamInfo.name = m_displayName;
|
||||
}
|
||||
BehaviorPropertyInfo& operator=(const AZStd::string& str)
|
||||
{
|
||||
// TODO: clean this up - this weird memory sharing was copied from legacy Cry - could be better.
|
||||
m_displayName = str;
|
||||
m_animNodeParamInfo.paramType = str; // set type to AnimParamType::ByString by assigning a string
|
||||
m_animNodeParamInfo.name = &m_displayName[0];
|
||||
m_animNodeParamInfo.name = m_displayName;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ const char* CAnimNode::GetParamName(const CAnimParamType& paramType) const
|
||||
SParamInfo info;
|
||||
if (GetParamInfoFromType(paramType, info))
|
||||
{
|
||||
return info.name;
|
||||
return info.name.c_str();
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
|
||||
Reference in New Issue
Block a user