diff options
author | Mike Krus <mike.krus@kdab.com> | 2018-04-04 09:53:27 +0100 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2018-04-09 11:51:08 +0000 |
commit | 5247d7146c65672bd245ceb0dc213dfb319919c4 (patch) | |
tree | 87159d0f24af725bb7c01c7495d71b3cc4bc76c2 /src/3rdparty/assimp/contrib/openddlparser/code/DDLNode.cpp | |
parent | af4972fd15e6b11a99c631ff91b3360ceb8be5cc (diff) |
Update Assimp to 4.1
Fixes build with C++17 / XCode 9.3
Change-Id: Ic1c19cc4b86e54e72dd4cfe054ec6d66f64b5a07
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/3rdparty/assimp/contrib/openddlparser/code/DDLNode.cpp')
-rw-r--r-- | src/3rdparty/assimp/contrib/openddlparser/code/DDLNode.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/3rdparty/assimp/contrib/openddlparser/code/DDLNode.cpp b/src/3rdparty/assimp/contrib/openddlparser/code/DDLNode.cpp index 0cc95bdfc..a7c557fc5 100644 --- a/src/3rdparty/assimp/contrib/openddlparser/code/DDLNode.cpp +++ b/src/3rdparty/assimp/contrib/openddlparser/code/DDLNode.cpp @@ -68,8 +68,8 @@ DDLNode::DDLNode( const std::string &type, const std::string &name, size_t idx, } DDLNode::~DDLNode() { - releaseDataType<Property>( m_properties ); - releaseDataType<Value>( m_value ); + delete m_properties; + delete m_value; releaseReferencedNames( m_references ); delete m_dtArrayList; @@ -77,6 +77,9 @@ DDLNode::~DDLNode() { if( s_allocatedNodes[ m_idx ] == this ) { s_allocatedNodes[ m_idx ] = ddl_nullptr; } + for ( size_t i = 0; i<m_children.size(); i++ ){ + delete m_children[ i ]; + } } void DDLNode::attachParent( DDLNode *parent ) { @@ -91,9 +94,8 @@ void DDLNode::attachParent( DDLNode *parent ) { } void DDLNode::detachParent() { - if( m_parent ) { - std::vector<DDLNode*>::iterator it; - it = std::find( m_parent->m_children.begin(), m_parent->m_children.end(), this ); + if( ddl_nullptr != m_parent ) { + DDLNodeIt it = std::find( m_parent->m_children.begin(), m_parent->m_children.end(), this ); if( m_parent->m_children.end() != it ) { m_parent->m_children.erase( it ); } @@ -126,6 +128,8 @@ const std::string &DDLNode::getName() const { } void DDLNode::setProperties( Property *prop ) { + if(m_properties!=ddl_nullptr) + delete m_properties; m_properties = prop; } @@ -187,6 +191,10 @@ Reference *DDLNode::getReferences() const { return m_references; } +void DDLNode::dump(IOStreamBase &/*stream*/) { + // Todo! +} + DDLNode *DDLNode::create( const std::string &type, const std::string &name, DDLNode *parent ) { const size_t idx( s_allocatedNodes.size() ); DDLNode *node = new DDLNode( type, name, idx, parent ); @@ -197,7 +205,7 @@ DDLNode *DDLNode::create( const std::string &type, const std::string &name, DDLN void DDLNode::releaseNodes() { if( s_allocatedNodes.size() > 0 ) { - for( DllNodeList::iterator it = s_allocatedNodes.begin(); it != s_allocatedNodes.end(); it++ ) { + for( DDLNodeIt it = s_allocatedNodes.begin(); it != s_allocatedNodes.end(); it++ ) { if( *it ) { delete *it; } |