summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Bing Ye2025-08-20 22:34:10 +0800
committerGravatar Nikias Bassen2025-09-27 01:49:33 +0200
commit7355dc8e8344f00fae0e24db72e461d985eb6381 (patch)
tree604cc49a3db1ea0146b540638ba6b2a36656e24d
parent91ba4263dd795f83eaa9c43e52c3be55e4f382a6 (diff)
downloadlibplist-7355dc8e8344f00fae0e24db72e461d985eb6381.tar.gz
libplist-7355dc8e8344f00fae0e24db72e461d985eb6381.tar.bz2
Fix Integer constructor to copy plist nodeHEADmaster
Updated the Integer(const PList::Integer&) constructor to free the existing plist node and copy the node from the input object, ensuring correct initialization.
-rw-r--r--src/Integer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Integer.cpp b/src/Integer.cpp
index 30a5405..653455d 100644
--- a/src/Integer.cpp
+++ b/src/Integer.cpp
@@ -35,7 +35,8 @@ Integer::Integer(plist_t node, Node* parent) : Node(node, parent)
Integer::Integer(const PList::Integer& i) : Node(PLIST_INT)
{
- plist_set_uint_val(_node, i.GetValue());
+ plist_free(_node);
+ _node = plist_copy(i.GetPlist());
}
Integer& Integer::operator=(const PList::Integer& i)