Commit 060eda6b authored by Aaron Burghardt's avatar Aaron Burghardt Committed by Nikias Bassen

Node.cpp: let plist_t operations free _node when in a container.

Fixes libimobiledevice/libplist#50.
parent 9834d85c
...@@ -88,7 +88,12 @@ Node::Node(plist_type type, Node* parent) : _parent(parent) ...@@ -88,7 +88,12 @@ Node::Node(plist_type type, Node* parent) : _parent(parent)
Node::~Node() Node::~Node()
{ {
plist_free(_node); /* If the Node is in a container, let _node be cleaned up by
* operations on the parent plist_t. Otherwise, duplicate frees
* occur when a Node is removed from or replaced in a Dictionary.
*/
if (_parent == NULL)
plist_free(_node);
_node = NULL; _node = NULL;
_parent = NULL; _parent = NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment