From 69dcdb39fc81ec7373ed1add05da5f3f124df438 Mon Sep 17 00:00:00 2001 From: gyboth Date: Thu, 4 Dec 2008 17:33:25 +0000 Subject: [PATCH] News bug causing freeze fixed. --- src/news.c | 26 +++++++++++++++++++++++++- src/start_end.c | 6 +++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/news.c b/src/news.c index 388de783..8d1a2a0f 100644 --- a/src/news.c +++ b/src/news.c @@ -131,6 +131,10 @@ gint news_get_title(const GArray *titles, gchar *title, gint *order, gboolean is_title, gboolean ignore_repetition) { +#ifdef DEBUG + printf("news_get_title\n"); +#endif + gint i; gint result; @@ -154,6 +158,10 @@ news_get_title(const GArray *titles, gchar *title, gint *order, gboolean news_check_for_repetition(gint id, gboolean is_title) { +#ifdef DEBUG + printf("news_check_for_repetition\n"); +#endif + gint i; gint end; @@ -232,6 +240,10 @@ news_set_match_tokens(const LiveGame *live_game) void news_set_scorer_tokens(const LiveGameStats *stats) { +#ifdef DEBUG + printf("news_set_scorer_tokens\n"); +#endif + gint i, j, k; GPtrArray *scorers[2]; GArray *goals[2]; @@ -340,6 +352,10 @@ news_set_scorer_tokens(const LiveGameStats *stats) void news_set_league_cup_tokens(const Fixture *fix) { +#ifdef DEBUG + printf("news_set_league_cup_tokens\n"); +#endif + gchar buf[SMALL]; const Cup *cup; const CupRound *cupround; @@ -385,13 +401,17 @@ news_set_league_cup_tokens(const Fixture *fix) if(fix->decisive) misc_token_add(token_rep_news, option_int("string_token_cup_match_winner", &tokens), - ((Team*)fixture_winner_of(fix, FALSE))->name); + g_strdup(((Team*)fixture_winner_of(fix, FALSE))->name)); } } void news_set_fixture_tokens(const Fixture *fix) { +#ifdef DEBUG + printf("news_set_fixture_tokens\n"); +#endif + gchar buf[SMALL]; gint avskill0, avskill1; @@ -522,6 +542,10 @@ news_load_news_file(const gchar *news_file, gboolean abort) gboolean news_check_match_relevant(const LiveGame *live_game) { +#ifdef DEBUG + printf("news_check_match_relevant\n"); +#endif + gint i; GArray *user_leagues; diff --git a/src/start_end.c b/src/start_end.c index 24083390..558d75e6 100644 --- a/src/start_end.c +++ b/src/start_end.c @@ -59,10 +59,10 @@ typedef void(*WeekFunc)(void); /** Array of functions called when a week round is ended. */ WeekFunc end_week_round_funcs[] = -{end_week_round_results, end_week_round_sort_tables, - end_week_round_update_fixtures, NULL}; /* {end_week_round_results, end_week_round_sort_tables, */ -/* end_week_round_update_fixtures, end_week_round_generate_news, NULL}; */ +/* end_week_round_update_fixtures, NULL}; */ +{end_week_round_results, end_week_round_sort_tables, + end_week_round_update_fixtures, end_week_round_generate_news, NULL}; /** Array of functions called when a week round is started. */