}
#endif
+/**
+ * Check if a plugin is already loaded
+ */
+static bool plugin_loaded(private_plugin_loader_t *this, char *name)
+{
+ enumerator_t *enumerator;
+ bool found = FALSE;
+ char *current;
+
+ enumerator = this->names->create_enumerator(this->names);
+ while (enumerator->enumerate(enumerator, ¤t))
+ {
+ if (streq(name, current))
+ {
+ found = TRUE;
+ break;
+ }
+ }
+ enumerator->destroy(enumerator);
+ return found;
+}
+
/**
* Implementation of plugin_loader_t.load_plugins.
*/
critical = TRUE;
token[len-1] = '\0';
}
+ if (plugin_loaded(this, token))
+ {
+ free(token);
+ continue;
+ }
plugin = load_plugin(this, path, token);
if (plugin)
{