From e47ff9ad473c04a1486bc558ace8778f15288da9 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Wed, 21 Sep 2011 09:46:54 +0200 Subject: [PATCH] Resolve GLib-Gobject-CRITICAL warnings --- zathura.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zathura.c b/zathura.c index 583f478..6a8a75b 100644 --- a/zathura.c +++ b/zathura.c @@ -254,8 +254,13 @@ zathura_free(zathura_t* zathura) zathura_db_free(zathura->database); /* free print settings */ - g_object_unref(zathura->print.settings); - g_object_unref(zathura->print.page_setup); + if(zathura->print.settings != NULL) { + g_object_unref(zathura->print.settings); + } + + if (zathura->print.page_setup != NULL) { + g_object_unref(zathura->print.page_setup); + } /* free registered plugins */ zathura_document_plugins_free(zathura);