aboutsummaryrefslogtreecommitdiff
path: root/src/slideshow.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-01-05 22:44:29 +0100
committerThomas White <taw@physics.org>2018-01-05 22:44:29 +0100
commit3a17352968dad0d44165dbb3513775005b516ca1 (patch)
treeea3cf95233a60f452ea1eecf403031d5c0393fbd /src/slideshow.c
parent32a34c806d191d542700b263403ce50cadca9f37 (diff)
Don't unref blank cursor if it was never allocated
Diffstat (limited to 'src/slideshow.c')
-rw-r--r--src/slideshow.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/slideshow.c b/src/slideshow.c
index 0b9cdcb..09f8919 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -81,7 +81,9 @@ static void slideshow_rerender(SCSlideshow *ss)
static gint ss_destroy_sig(GtkWidget *widget, SCSlideshow *ss)
{
- g_object_unref(ss->blank_cursor);
+ if ( ss->blank_cursor != NULL ) {
+ g_object_unref(ss->blank_cursor);
+ }
if ( ss->surface != NULL ) {
cairo_surface_destroy(ss->surface);
}
@@ -177,6 +179,8 @@ SCSlideshow *sc_slideshow_new(struct presentation *p)
ss->blank = 0;
ss->p = p;
ss->cur_slide = NULL;
+ ss->blank_cursor = NULL;
+ ss->surface = NULL;
if ( ss->inhibit == NULL ) {
ss->inhibit = inhibit_prepare();