diff options
Diffstat (limited to 'src/Node.cpp')
| -rw-r--r-- | src/Node.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Node.cpp b/src/Node.cpp index aaadd52..3da401e 100644 --- a/src/Node.cpp +++ b/src/Node.cpp | |||
| @@ -88,7 +88,12 @@ Node::Node(plist_type type, Node* parent) : _parent(parent) | |||
| 88 | 88 | ||
| 89 | Node::~Node() | 89 | Node::~Node() |
| 90 | { | 90 | { |
| 91 | plist_free(_node); | 91 | /* If the Node is in a container, let _node be cleaned up by |
| 92 | * operations on the parent plist_t. Otherwise, duplicate frees | ||
| 93 | * occur when a Node is removed from or replaced in a Dictionary. | ||
| 94 | */ | ||
| 95 | if (_parent == NULL) | ||
| 96 | plist_free(_node); | ||
| 92 | _node = NULL; | 97 | _node = NULL; |
| 93 | _parent = NULL; | 98 | _parent = NULL; |
| 94 | } | 99 | } |
