Tidy up plugin cleanup code.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3076 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
567d0634b7
commit
6133c0b5d6
@ -16,6 +16,8 @@
|
|||||||
their visible group elements are hidden or destroyed.
|
their visible group elements are hidden or destroyed.
|
||||||
* tagmanager/css.c:
|
* tagmanager/css.c:
|
||||||
Fix gcc warning, wrap line.
|
Fix gcc warning, wrap line.
|
||||||
|
* src/plugins.c:
|
||||||
|
Tidy up plugin cleanup code.
|
||||||
|
|
||||||
|
|
||||||
2008-10-12 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
2008-10-12 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
@ -662,12 +662,13 @@ static gboolean is_active_plugin(Plugin *plugin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Clean up anything used by an active plugin */
|
||||||
static void
|
static void
|
||||||
plugin_unload(Plugin *plugin)
|
plugin_cleanup(Plugin *plugin)
|
||||||
{
|
{
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
|
|
||||||
if (is_active_plugin(plugin) && plugin->cleanup)
|
if (plugin->cleanup)
|
||||||
plugin->cleanup();
|
plugin->cleanup();
|
||||||
|
|
||||||
remove_callbacks(plugin);
|
remove_callbacks(plugin);
|
||||||
@ -679,7 +680,6 @@ plugin_unload(Plugin *plugin)
|
|||||||
if (widget)
|
if (widget)
|
||||||
gtk_widget_destroy(widget);
|
gtk_widget_destroy(widget);
|
||||||
|
|
||||||
active_plugin_list = g_list_remove(active_plugin_list, plugin);
|
|
||||||
geany_debug("Unloaded: %s", plugin->filename);
|
geany_debug("Unloaded: %s", plugin->filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -690,7 +690,10 @@ plugin_free(Plugin *plugin)
|
|||||||
g_return_if_fail(plugin);
|
g_return_if_fail(plugin);
|
||||||
g_return_if_fail(plugin->module);
|
g_return_if_fail(plugin->module);
|
||||||
|
|
||||||
plugin_unload(plugin);
|
if (is_active_plugin(plugin))
|
||||||
|
plugin_cleanup(plugin);
|
||||||
|
|
||||||
|
active_plugin_list = g_list_remove(active_plugin_list, plugin);
|
||||||
|
|
||||||
if (plugin->module != NULL && ! g_module_close(plugin->module))
|
if (plugin->module != NULL && ! g_module_close(plugin->module))
|
||||||
g_warning("%s: %s", plugin->filename, g_module_error());
|
g_warning("%s: %s", plugin->filename, g_module_error());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user