summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/assimp/contrib/openddlparser/code/DDLNode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/assimp/contrib/openddlparser/code/DDLNode.cpp')
-rw-r--r--src/3rdparty/assimp/contrib/openddlparser/code/DDLNode.cpp20
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;
}