Prune unused nodes from trie

This commit is contained in:
topjohnwu
2021-10-09 02:15:03 -07:00
parent 2fef98a5af
commit 7f18616cc0
7 changed files with 54 additions and 15 deletions

View File

@@ -176,7 +176,7 @@ struct resetprop : public sysprop {
// Always delete existing read-only properties, because they could be
// long properties and cannot directly go through __system_property_update
if (pi != nullptr && str_starts(name, "ro.")) {
delprop(name, false);
__system_property_delete(name, false /* Do NOT trim node */);
pi = nullptr;
}
@@ -228,7 +228,7 @@ struct resetprop : public sysprop {
return 1;
LOGD("resetprop: delete prop [%s]\n", name);
int ret = __system_property_delete(name);
int ret = __system_property_delete(name, true);
if (persist && str_starts(name, "persist.")) {
if (persist_deleteprop(name))
ret = 0;