--- a/libpurple/prefs.c Tue Nov 05 20:24:59 2019 -0500
+++ b/libpurple/prefs.c Tue Nov 05 20:27:32 2019 -0500
@@ -758,35 +758,16 @@
-remove_pref(struct purple_pref *pref)
+free_pref(struct purple_pref *pref)
- while(pref->first_child)
- remove_pref(pref->first_child);
- if(pref->parent->first_child == pref) {
- pref->parent->first_child = pref->sibling;
- struct purple_pref *sib = pref->parent->first_child;
- while(sib && sib->sibling != pref)
- sib->sibling = pref->sibling;
name = pref_full_name(pref);
purple_debug_info("prefs", "removing pref %s\n", name);
g_hash_table_remove(prefs_hash, name);
@@ -798,6 +779,53 @@
+remove_pref(struct purple_pref *pref) + struct purple_pref *child; + child = pref->first_child; + struct purple_pref *next; + if (child->first_child) { + next = child->first_child; + } else if (child->sibling) { + if (child->parent != pref) { + if (pref->parent->first_child == pref) { + pref->parent->first_child = pref->sibling; + child = pref->parent->first_child; + while (child && child->sibling != pref) { + child = child->sibling; + child->sibling = pref->sibling; purple_prefs_remove(const char *name)