Fix a crash when reloading AudioControlEditor controls (#2729)

* Fix a crash when reloading ACE controls data

The crash was due to destruction of xml_node that was held in a
unique_ptr.  Rapidxml has a very rudimentary memory allocation design,
so in most cases dynamic allocations aren't even made.  The memory_pool
does all the cleanup in its destructor, so having a unique_ptr run its
default_delete was causing the crash.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Fix numerical conversion warnings

Wwise source files needed a few fixes for the numerical conversion
warning changes that went in recently.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
This commit is contained in:
amzn-phist
2021-08-06 16:23:01 -05:00
committed by GitHub
parent 9a8a411a0b
commit 6b2c9cbede
5 changed files with 38 additions and 36 deletions
@@ -356,8 +356,8 @@ namespace AudioControls
{
if (!connectionNode.m_isValid)
{
auto nodeCopy = SRawConnectionData::DeepCopyNode(connectionNode.m_xmlNode.get());
node->append_node(nodeCopy.release());
XmlAllocator& xmlAlloc(AudioControls::s_xmlAllocator);
node->append_node(xmlAlloc.clone_node(connectionNode.m_xmlNode));
}
}
@@ -371,7 +371,7 @@ namespace AudioControls
childNode != nullptr)
{
node->append_node(childNode);
control->m_connectionNodes.push_back(SRawConnectionData(childNode, true));
control->m_connectionNodes.emplace_back(childNode, true);
}
}
}