diff --git a/database-sqlite.c b/database-sqlite.c index a9f0a6d..8e7600f 100644 --- a/database-sqlite.c +++ b/database-sqlite.c @@ -79,7 +79,7 @@ zathura_sqldatabase_new(const char* path) zathura_database_t* db = g_object_new(ZATHURA_TYPE_SQLDATABASE, "path", path, NULL); zathura_sqldatabase_private_t* priv = ZATHURA_SQLDATABASE_GET_PRIVATE(db); if (priv->session == NULL) { - g_object_unref(db); + g_object_unref(G_OBJECT(db)); return NULL; } diff --git a/database.c b/database.c index d042747..81e3a27 100644 --- a/database.c +++ b/database.c @@ -9,16 +9,6 @@ zathura_database_default_init(ZathuraDatabaseInterface* GIRARA_UNUSED(iface)) { } -void -zathura_db_free(zathura_database_t* db) -{ - if (db == NULL) { - return; - } - - g_object_unref(db); -} - bool zathura_db_add_bookmark(zathura_database_t* db, const char* file, zathura_bookmark_t* bookmark) diff --git a/database.h b/database.h index 5161b35..0c8dd44 100644 --- a/database.h +++ b/database.h @@ -50,13 +50,6 @@ struct _ZathuraDatabaseInterface GType zathura_database_get_type(void); -/** - * Free database instance. - * - * @param db The database instance to free. - */ -void zathura_db_free(zathura_database_t* db); - /** * Add or update bookmark in the database. * diff --git a/zathura.c b/zathura.c index 80bf2fb..4762e8f 100644 --- a/zathura.c +++ b/zathura.c @@ -287,7 +287,9 @@ zathura_free(zathura_t* zathura) girara_list_free(zathura->bookmarks.bookmarks); /* database */ - zathura_db_free(zathura->database); + if (zathura->database != NULL) { + g_object_unref(G_OBJECT(zathura->database)); + } /* free print settings */ if (zathura->print.settings != NULL) {