summaryrefslogtreecommitdiff
path: root/XMPCore/source
diff options
context:
space:
mode:
Diffstat (limited to 'XMPCore/source')
-rw-r--r--XMPCore/source/XMPUtils-FileInfo.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/XMPCore/source/XMPUtils-FileInfo.cpp b/XMPCore/source/XMPUtils-FileInfo.cpp
index 9b0ab53..a2a9f99 100644
--- a/XMPCore/source/XMPUtils-FileInfo.cpp
+++ b/XMPCore/source/XMPUtils-FileInfo.cpp
@@ -784,9 +784,12 @@ AppendSubtree ( const XMP_Node * sourceNode, XMP_Node * destParent,
for ( size_t sourceNum = 0, sourceLim = sourceNode->children.size(); sourceNum != sourceLim && destNode!= NULL; ++sourceNum ) {
const XMP_Node * sourceField = sourceNode->children[sourceNum];
AppendSubtree ( sourceField, destNode, mergeCompound, replaceOld, deleteEmpty );
- if ( deleteEmpty && destNode->children.empty() ) {
- delete ( destNode );
- destParent->children.erase ( destPos );
+
+ if (deleteEmpty && destNode->children.empty())
+ {
+ delete (destNode);
+ destNode = NULL;
+ destParent->children.erase(destPos);
}
}