From e5bdc85baa00c3abbf22559a26070c23612f214f Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 1 Aug 2012 13:59:42 +0200 Subject: some NULL pointer checks in transcript widget default interactive format attributes may be NULL (i.e. don't change these attributes) but pango/gdk free functions cannot handle NULL pointers gracefully * only results in assertions now since windows are explicitly destroyed (the info window was not destroyed at all previously) --- lib/gtk-experiment-widgets/gtk-experiment-transcript.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/gtk-experiment-widgets/gtk-experiment-transcript.c b/lib/gtk-experiment-widgets/gtk-experiment-transcript.c index a577691..3575bb4 100644 --- a/lib/gtk-experiment-widgets/gtk-experiment-transcript.c +++ b/lib/gtk-experiment-widgets/gtk-experiment-transcript.c @@ -301,9 +301,12 @@ gtk_experiment_transcript_finalize(GObject *gobject) g_free(trans->speaker); - pango_font_description_free(trans->interactive_format.default_font); - gdk_color_free(trans->interactive_format.default_text_color); - gdk_color_free(trans->interactive_format.default_bg_color); + if (trans->interactive_format.default_font != NULL) + pango_font_description_free(trans->interactive_format.default_font); + if (trans->interactive_format.default_text_color != NULL) + gdk_color_free(trans->interactive_format.default_text_color); + if (trans->interactive_format.default_bg_color != NULL) + gdk_color_free(trans->interactive_format.default_bg_color); experiment_reader_free_contributions(trans->priv->contribs); gtk_experiment_transcript_free_formats(trans->priv->formats); -- cgit v1.2.3