Prevent loading the same plugin in different paths.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1770 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
6c36b8dcab
commit
1f2aa9d983
@ -2,6 +2,7 @@
|
||||
|
||||
* configure.in: Fix error in "make install" caused by old automake
|
||||
versions and intltool.
|
||||
* src/plugins.c: Prevent loading the same plugin in different paths.
|
||||
|
||||
|
||||
2007-08-03 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
|
@ -161,16 +161,24 @@ geany_data_init()
|
||||
static gboolean
|
||||
plugin_loaded(GModule *module)
|
||||
{
|
||||
const gchar *fname = g_module_name(module);
|
||||
gchar *basename_module, *basename_loaded;
|
||||
GList *item;
|
||||
|
||||
basename_module = g_path_get_basename(g_module_name(module));
|
||||
for (item = plugin_list; item != NULL; item = g_list_next(item))
|
||||
{
|
||||
Plugin *p = item->data;
|
||||
basename_loaded = g_path_get_basename(
|
||||
g_module_name(((Plugin*)item->data)->module));
|
||||
|
||||
if (utils_str_equal(fname, g_module_name(p->module)))
|
||||
if (utils_str_equal(basename_module, basename_loaded))
|
||||
{
|
||||
g_free(basename_loaded);
|
||||
g_free(basename_module);
|
||||
return TRUE;
|
||||
}
|
||||
g_free(basename_loaded);
|
||||
}
|
||||
g_free(basename_module);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user