summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-07-01 19:28:26 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-07-01 19:28:26 (GMT)
commit6e8544094334d134d51cd9ca549a7c75b2e8fdab (patch)
treedcd5fb231eb58cacbe921ebaba34adf86388c830 /src/core
parentbfd453d597d23b5c782aa8d40eb744d2ab56838e (diff)
Fixed the reference counters for the explorer and the resolver.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.c7
-rw-r--r--src/core/global.c6
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));
+
}