summaryrefslogtreecommitdiffstats
path: root/src/Dictionary.cpp
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2025-03-01 23:56:06 +0100
committerGravatar Nikias Bassen2025-03-01 23:56:06 +0100
commit5ea6de69afcf11f2d2e59258cb055a5b1fdb5f82 (patch)
treeadf925cb6b61b5279c2ad3627b2fd7bc48b34300 /src/Dictionary.cpp
parentd40f03e4090edafea75f04a1697ef0384231d333 (diff)
downloadlibplist-5ea6de69afcf11f2d2e59258cb055a5b1fdb5f82.tar.gz
libplist-5ea6de69afcf11f2d2e59258cb055a5b1fdb5f82.tar.bz2
C++: Use `free()` instead of `delete` for C things
Diffstat (limited to 'src/Dictionary.cpp')
-rw-r--r--src/Dictionary.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Dictionary.cpp b/src/Dictionary.cpp
index 30c20b6..f5fd239 100644
--- a/src/Dictionary.cpp
+++ b/src/Dictionary.cpp
@@ -40,7 +40,7 @@ static void dictionary_fill(Dictionary *_this, std::map<std::string,Node*> &map,
40 plist_dict_next_item(node, it, &key, &subnode); 40 plist_dict_next_item(node, it, &key, &subnode);
41 if (key && subnode) 41 if (key && subnode)
42 map[std::string(key)] = Node::FromPlist(subnode, _this); 42 map[std::string(key)] = Node::FromPlist(subnode, _this);
43 delete key; 43 free(key);
44 } while (subnode); 44 } while (subnode);
45 free(it); 45 free(it);
46} 46}
@@ -176,9 +176,9 @@ void Dictionary::Remove(Node* node)
176 plist_dict_get_item_key(node->GetPlist(), &key); 176 plist_dict_get_item_key(node->GetPlist(), &key);
177 plist_dict_remove_item(_node, key); 177 plist_dict_remove_item(_node, key);
178 std::string skey = key; 178 std::string skey = key;
179 delete key; 179 free(key);
180 _map.erase(skey); 180 _map.erase(skey);
181 delete node; 181 free(node);
182 } 182 }
183} 183}
184 184