comparison libgaim/savedstatuses.c @ 14909:c3a7d40d64bb

[gaim-migrate @ 17681] Modified sf patch #1590052, from Ari Pollak Fixes two possible crashes that can happen after deleting an account committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 06 Nov 2006 07:25:05 +0000
parents 091b6ce6372e
children 717935e035ca
comparison
equal deleted inserted replaced
14908:fd321da41de4 14909:c3a7d40d64bb
653 return; 653 return;
654 } 654 }
655 } 655 }
656 } 656 }
657 657
658 /*
659 * This gets called when an account is deleted. We iterate through
660 * all of our saved statuses and delete any substatuses that may
661 * exist for this account.
662 */
663 static void
664 gaim_savedstatus_unset_all_substatuses(const GaimAccount *account,
665 gpointer user_data)
666 {
667 GList *iter;
668 GaimSavedStatus *status;
669
670 g_return_if_fail(account != NULL);
671
672 for (iter = saved_statuses; iter != NULL; iter = iter->next)
673 {
674 status = (GaimSavedStatus *)iter->data;
675 gaim_savedstatus_unset_substatus(status, account);
676 }
677 }
678
658 gboolean 679 gboolean
659 gaim_savedstatus_delete(const char *title) 680 gaim_savedstatus_delete(const char *title)
660 { 681 {
661 GaimSavedStatus *status; 682 GaimSavedStatus *status;
662 time_t creation_time, current, idleaway; 683 time_t creation_time, current, idleaway;
1140 gaim_marshal_VOID__POINTER_POINTER, NULL, 2, 1161 gaim_marshal_VOID__POINTER_POINTER, NULL, 2,
1141 gaim_value_new(GAIM_TYPE_SUBTYPE, 1162 gaim_value_new(GAIM_TYPE_SUBTYPE,
1142 GAIM_SUBTYPE_SAVEDSTATUS), 1163 GAIM_SUBTYPE_SAVEDSTATUS),
1143 gaim_value_new(GAIM_TYPE_SUBTYPE, 1164 gaim_value_new(GAIM_TYPE_SUBTYPE,
1144 GAIM_SUBTYPE_SAVEDSTATUS)); 1165 GAIM_SUBTYPE_SAVEDSTATUS));
1166
1167 gaim_signal_connect(gaim_accounts_get_handle(), "account-removed",
1168 handle,
1169 GAIM_CALLBACK(gaim_savedstatus_unset_all_substatuses),
1170 NULL);
1145 } 1171 }
1146 1172
1147 void 1173 void
1148 gaim_savedstatuses_uninit(void) 1174 gaim_savedstatuses_uninit(void)
1149 { 1175 {