# HG changeset patch # User Sadrul Habib Chowdhury # Date 1170008360 0 # Node ID 7865f302c5fb6966529a4920b6c824e27e1b8ac9 # Parent c9497aad9fc40ef6d587e5f3110e3abc9a5c3c99 Remove the timeout-source to fix a possible crash. diff -r c9497aad9fc4 -r 7865f302c5fb pidgin/plugins/cap/cap.c --- a/pidgin/plugins/cap/cap.c Sat Jan 27 17:46:52 2007 +0000 +++ b/pidgin/plugins/cap/cap.c Sun Jan 28 18:19:20 2007 +0000 @@ -136,6 +136,8 @@ g_free(stats->prediction); /* g_free(stats->hourly_usage); */ /* g_free(stats->daily_usage); */ + if (stats->timeout_source_id != 0) + g_source_remove(stats->timeout_source_id); g_free(stats); } @@ -345,6 +347,7 @@ static void sent_im_msg(GaimAccount *account, const char *receiver, const char *message) { GaimBuddy *buddy; guint interval, words; + CapStatistics *stats = NULL; buddy = gaim_find_buddy(account, receiver); @@ -354,7 +357,7 @@ interval = gaim_prefs_get_int("/plugins/gtk/cap/max_msg_difference") * 1000 * 60; words = word_count(message); - CapStatistics *stats = get_stats_for(buddy); + stats = get_stats_for(buddy); insert_word_count(gaim_account_get_username(account), receiver, words); stats->last_message = time(NULL);