aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-08-01 13:59:42 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-08-01 13:59:42 +0200
commite5bdc85baa00c3abbf22559a26070c23612f214f (patch)
tree632f3468581f7d5f28c71cc652ab4af9fb025ed4
parent6c8739272766902df1c3b8f2ca7cee35c34923c1 (diff)
downloadgtk-vlc-player-e5bdc85baa00c3abbf22559a26070c23612f214f.tar.gz
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)
-rw-r--r--lib/gtk-experiment-widgets/gtk-experiment-transcript.c9
1 files 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);