aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/reclaim_attribute.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/reclaim/reclaim_attribute.c')
-rw-r--r--src/reclaim/reclaim_attribute.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/reclaim/reclaim_attribute.c b/src/reclaim/reclaim_attribute.c
index 2217987ac..14690d7c9 100644
--- a/src/reclaim/reclaim_attribute.c
+++ b/src/reclaim/reclaim_attribute.c
@@ -102,6 +102,37 @@ init ()
102 NULL); 102 NULL);
103} 103}
104 104
105/**
106 * Dual function to #init().
107 */
108void __attribute__ ((destructor))
109RECLAIM_ATTRIBUTE_fini ()
110{
111 struct Plugin *plugin;
112 const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get ();
113 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default ();
114
115 if (pd != dpd)
116 GNUNET_OS_init (dpd);
117
118 for (unsigned int i = 0; i < num_plugins; i++)
119 {
120 plugin = attr_plugins[i];
121 GNUNET_break (NULL ==
122 GNUNET_PLUGIN_unload (plugin->library_name,
123 plugin->api));
124 GNUNET_free (plugin->library_name);
125 GNUNET_free (plugin);
126 }
127 GNUNET_free (attr_plugins);
128
129 if (pd != dpd)
130 GNUNET_OS_init (pd);
131
132 attr_plugins = NULL;
133}
134
135
105 136
106/** 137/**
107 * Convert a type name to the corresponding number 138 * Convert a type name to the corresponding number