aboutsummaryrefslogtreecommitdiff
path: root/src/gnsrecord/gnsrecord.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnsrecord/gnsrecord.c')
-rw-r--r--src/gnsrecord/gnsrecord.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c
index 82fb71c06..8d5a6d95b 100644
--- a/src/gnsrecord/gnsrecord.c
+++ b/src/gnsrecord/gnsrecord.c
@@ -102,8 +102,15 @@ init ()
102 if (1 == once) 102 if (1 == once)
103 return; 103 return;
104 once = 1; 104 once = 1;
105 const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get ();
106 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default ();
107
108 if (pd != dpd)
109 GNUNET_OS_init (dpd);
105 GNUNET_PLUGIN_load_all ("libgnunet_plugin_gnsrecord_", NULL, 110 GNUNET_PLUGIN_load_all ("libgnunet_plugin_gnsrecord_", NULL,
106 &add_plugin, NULL); 111 &add_plugin, NULL);
112 if (pd != dpd)
113 GNUNET_OS_init (pd);
107} 114}
108 115
109 116
@@ -114,6 +121,11 @@ void __attribute__ ((destructor))
114GNSRECORD_fini () 121GNSRECORD_fini ()
115{ 122{
116 struct Plugin *plugin; 123 struct Plugin *plugin;
124 const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get ();
125 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default ();
126
127 if (pd != dpd)
128 GNUNET_OS_init (dpd);
117 129
118 for (unsigned int i = 0; i < num_plugins; i++) 130 for (unsigned int i = 0; i < num_plugins; i++)
119 { 131 {
@@ -124,7 +136,11 @@ GNSRECORD_fini ()
124 GNUNET_free (plugin->library_name); 136 GNUNET_free (plugin->library_name);
125 GNUNET_free (plugin); 137 GNUNET_free (plugin);
126 } 138 }
127 GNUNET_free_non_null (gns_plugins); 139 GNUNET_free (gns_plugins);
140
141 if (pd != dpd)
142 GNUNET_OS_init (pd);
143
128 gns_plugins = NULL; 144 gns_plugins = NULL;
129 once = 0; 145 once = 0;
130 num_plugins = 0; 146 num_plugins = 0;