From 6e8544094334d134d51cd9ca549a7c75b2e8fdab Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Mon, 1 Jul 2019 21:28:26 +0200
Subject: Fixed the reference counters for the explorer and the resolver.

---
 src/core/core.c   | 7 -------
 src/core/global.c | 6 ++++++
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/core/core.c b/src/core/core.c
index 47e808d..4b7e3ce 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -131,22 +131,15 @@ bool load_all_basic_components(void)
 
 void unload_all_basic_components(void)
 {
-    GContentExplorer *explorer;             /* Explorateur de contenus     */
-    GContentResolver *resolver;             /* Résolveur de contenus       */
-
     unload_collection_definitions();
 
     unload_demanglers_definitions();
 
     unload_processors_definitions();
 
-    explorer = g_content_explorer_new();
     set_current_content_explorer(NULL);
-    g_object_unref(G_OBJECT(explorer));
 
-    resolver = g_content_resolver_new();
     set_current_content_resolver(NULL);
-    g_object_unref(G_OBJECT(resolver));
 
     exit_global_works();
 
diff --git a/src/core/global.c b/src/core/global.c
index f61def6..53ae752 100644
--- a/src/core/global.c
+++ b/src/core/global.c
@@ -145,6 +145,9 @@ void set_current_content_explorer(GContentExplorer *explorer)
 
     _explorer = explorer;
 
+    if (explorer != NULL)
+        g_object_ref_sink(G_OBJECT(explorer));
+
 }
 
 
@@ -190,6 +193,9 @@ void set_current_content_resolver(GContentResolver *resolver)
 
     _resolver = resolver;
 
+    if (resolver != NULL)
+        g_object_ref_sink(G_OBJECT(resolver));
+
 }
 
 
-- 
cgit v0.11.2-87-g4458