[tracker-miners/wip/carlosg/cue-file-lookups: 1/5] tracker-extract: Add missing infrastructure to shutdown modules
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/cue-file-lookups: 1/5] tracker-extract: Add missing infrastructure to shutdown modules
- Date: Mon, 3 Oct 2022 12:01:44 +0000 (UTC)
commit e9e61b9be2c6058ea8c671213369f2fb8e54bd6b
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Oct 3 11:04:42 2022 +0200
tracker-extract: Add missing infrastructure to shutdown modules
We already did let extractor modules provide a shutdown function, but
this was never called. Add the missing code so that these shutdown
functions are called during finalization.
src/libtracker-extract/tracker-module-manager.c | 17 +++++++++++++++++
src/libtracker-extract/tracker-module-manager.h | 2 ++
src/tracker-extract/tracker-extract.c | 2 +-
3 files changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-extract/tracker-module-manager.c b/src/libtracker-extract/tracker-module-manager.c
index 19b60999f..42406f66f 100644
--- a/src/libtracker-extract/tracker-module-manager.c
+++ b/src/libtracker-extract/tracker-module-manager.c
@@ -607,3 +607,20 @@ tracker_extract_module_manager_get_hash (const gchar *mimetype)
return NULL;
}
+
+void
+tracker_module_manager_shutdown_modules (void)
+{
+ GHashTableIter iter;
+ ModuleInfo *module_info;
+ guint i;
+
+ g_return_if_fail (initialized == TRUE);
+
+ g_hash_table_iter_init (&iter, modules);
+
+ while (g_hash_table_iter_next (&iter, NULL, &module_info)) {
+ if (module_info->shutdown_func)
+ module_info->shutdown_func ();
+ }
+}
diff --git a/src/libtracker-extract/tracker-module-manager.h b/src/libtracker-extract/tracker-module-manager.h
index d82cd6820..e25d1254b 100644
--- a/src/libtracker-extract/tracker-module-manager.h
+++ b/src/libtracker-extract/tracker-module-manager.h
@@ -56,6 +56,8 @@ GList * tracker_extract_module_manager_get_matching_rules (const gchar *mimetype
void tracker_module_manager_load_modules (void);
+void tracker_module_manager_shutdown_modules (void);
+
G_END_DECLS
#endif /* __TRACKER_EXTRACT_MODULE_MANAGER_H__ */
diff --git a/src/tracker-extract/tracker-extract.c b/src/tracker-extract/tracker-extract.c
index d46d2e245..1741e8252 100644
--- a/src/tracker-extract/tracker-extract.c
+++ b/src/tracker-extract/tracker-extract.c
@@ -144,7 +144,7 @@ tracker_extract_finalize (GObject *object)
priv = TRACKER_EXTRACT_GET_PRIVATE (object);
- /* FIXME: Shutdown modules? */
+ tracker_module_manager_shutdown_modules ();
g_hash_table_destroy (priv->single_thread_extractors);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]