diff options
Diffstat (limited to 'src/reclaim/reclaim_credential.c')
-rw-r--r-- | src/reclaim/reclaim_credential.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/reclaim/reclaim_credential.c b/src/reclaim/reclaim_credential.c index b85ba5955..05601c3d3 100644 --- a/src/reclaim/reclaim_credential.c +++ b/src/reclaim/reclaim_credential.c | |||
@@ -104,6 +104,38 @@ init () | |||
104 | 104 | ||
105 | 105 | ||
106 | /** | 106 | /** |
107 | * Dual function to #init(). | ||
108 | */ | ||
109 | void __attribute__ ((destructor)) | ||
110 | RECLAIM_CREDENTIAL_fini () | ||
111 | { | ||
112 | struct Plugin *plugin; | ||
113 | const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get (); | ||
114 | const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); | ||
115 | |||
116 | if (pd != dpd) | ||
117 | GNUNET_OS_init (dpd); | ||
118 | |||
119 | for (unsigned int i = 0; i < num_plugins; i++) | ||
120 | { | ||
121 | plugin = credential_plugins[i]; | ||
122 | GNUNET_break (NULL == | ||
123 | GNUNET_PLUGIN_unload (plugin->library_name, | ||
124 | plugin->api)); | ||
125 | GNUNET_free (plugin->library_name); | ||
126 | GNUNET_free (plugin); | ||
127 | } | ||
128 | GNUNET_free (credential_plugins); | ||
129 | |||
130 | if (pd != dpd) | ||
131 | GNUNET_OS_init (pd); | ||
132 | |||
133 | credential_plugins = NULL; | ||
134 | } | ||
135 | |||
136 | |||
137 | |||
138 | /** | ||
107 | * Convert an credential type name to the corresponding number | 139 | * Convert an credential type name to the corresponding number |
108 | * | 140 | * |
109 | * @param typename name to convert | 141 | * @param typename name to convert |