From 2da759149ba78111b2be5f5435aa99463f148065 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 20 Jan 2016 02:21:15 +0100 Subject: [PATCH] Remove signal handler when closing Signed-off-by: Sebastian Ramacher --- zathura/zathura.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/zathura/zathura.c b/zathura/zathura.c index 31080a6..36eab75 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -93,7 +93,8 @@ zathura_create(void) } /* UI */ - if ((zathura->ui.session = girara_session_create()) == NULL) { + zathura->ui.session = girara_session_create(); + if (zathura->ui.session == NULL) { goto error_out; } @@ -326,6 +327,13 @@ zathura_free(zathura_t* zathura) document_close(zathura, false); +#ifdef G_OS_UNIX + if (zathura->signals.sigterm > 0) { + g_source_remove(zathura->signals.sigterm); + zathura->signals.sigterm = 0; + } +#endif + /* stop D-Bus */ if (zathura->dbus != NULL) { g_object_unref(zathura->dbus); @@ -870,7 +878,7 @@ document_open(zathura_t* zathura, const char* path, const char* uri, const char* } /* set up recolor info in ZathuraRenderer */ - char* recolor_dark = NULL; + char* recolor_dark = NULL; char* recolor_light = NULL; girara_setting_get(zathura->ui.session, "recolor-darkcolor", &recolor_dark); girara_setting_get(zathura->ui.session, "recolor-lightcolor", &recolor_light);