From f0c97bff1959b0683675a86ccff5185c17679ed6 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Tue, 23 Aug 2022 17:38:47 +0200 Subject: [PATCH] [dbi]: mongo: merge all parts from ogs_dbi_final() into ogs_mongoc_final() Nobody is calling ogs_mongoc_final() directly. In preparation of making ogs_dbi_final() more generic --- lib/dbi/mongo/ogs-mongoc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dbi/mongo/ogs-mongoc.c b/lib/dbi/mongo/ogs-mongoc.c index f3b38ae7f..cdb4fae23 100644 --- a/lib/dbi/mongo/ogs-mongoc.c +++ b/lib/dbi/mongo/ogs-mongoc.c @@ -134,6 +134,10 @@ int ogs_mongoc_init(const char *db_uri) void ogs_mongoc_final(void) { + if (self.collection.subscriber) { + mongoc_collection_destroy(self.collection.subscriber); + } + if (self.database) { mongoc_database_destroy(self.database); self.database = NULL; @@ -200,9 +204,5 @@ int ogs_dbi_mongo_init(const char *db_uri) void ogs_dbi_final() { - if (self.collection.subscriber) { - mongoc_collection_destroy(self.collection.subscriber); - } - ogs_mongoc_final(); }