comparison libpurple/prefs.c @ 25398:3687049b4faf

propagate from branch 'im.pidgin.pidgin' (head c5b982597812ab3c0fd2dbca9be31f173fda67bb) to branch 'im.pidgin.pidgin.next.minor' (head 4f8748faa3551f9475017bfe39dd11ff5e560cf0)
author Richard Laager <rlaager@wiktel.com>
date Thu, 22 Jan 2009 19:46:18 +0000
parents 94a6eb10c691 7e2f27351358
children 8290e36a5a73
comparison
equal deleted inserted replaced
25397:716b14deee97 25398:3687049b4faf
692 remove_pref(struct purple_pref *pref) 692 remove_pref(struct purple_pref *pref)
693 { 693 {
694 char *name; 694 char *name;
695 GSList *l; 695 GSList *l;
696 696
697 if(!pref || pref == &prefs) 697 if(!pref)
698 return; 698 return;
699 699
700 while(pref->first_child) 700 while(pref->first_child)
701 remove_pref(pref->first_child); 701 remove_pref(pref->first_child);
702
703 if(pref == &prefs)
704 return;
702 705
703 if(pref->parent->first_child == pref) { 706 if(pref->parent->first_child == pref) {
704 pref->parent->first_child = pref->sibling; 707 pref->parent->first_child = pref->sibling;
705 } else { 708 } else {
706 struct purple_pref *sib = pref->parent->first_child; 709 struct purple_pref *sib = pref->parent->first_child;
710 sib->sibling = pref->sibling; 713 sib->sibling = pref->sibling;
711 } 714 }
712 715
713 name = pref_full_name(pref); 716 name = pref_full_name(pref);
714 717
715 purple_debug_info("prefs", "removing pref %s\n", name); 718 if (prefs_loaded)
719 purple_debug_info("prefs", "removing pref %s\n", name);
716 720
717 g_hash_table_remove(prefs_hash, name); 721 g_hash_table_remove(prefs_hash, name);
718 g_free(name); 722 g_free(name);
719 723
720 free_pref_value(pref); 724 free_pref_value(pref);
1444 purple_timeout_remove(save_timer); 1448 purple_timeout_remove(save_timer);
1445 save_timer = 0; 1449 save_timer = 0;
1446 sync_prefs(); 1450 sync_prefs();
1447 } 1451 }
1448 1452
1449
1450 prefs_loaded = FALSE; 1453 prefs_loaded = FALSE;
1451 } 1454 purple_prefs_destroy();
1455 g_hash_table_destroy(prefs_hash);
1456 prefs_hash = NULL;
1457
1458 }