SF.net SVN: geany:[3076] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Mon Oct 13 15:40:13 UTC 2008


Revision: 3076
          http://geany.svn.sourceforge.net/geany/?rev=3076&view=rev
Author:   ntrel
Date:     2008-10-13 15:40:12 +0000 (Mon, 13 Oct 2008)

Log Message:
-----------
Tidy up plugin cleanup code.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/plugins.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-10-13 15:26:41 UTC (rev 3075)
+++ trunk/ChangeLog	2008-10-13 15:40:12 UTC (rev 3076)
@@ -16,6 +16,8 @@
    their visible group elements are hidden or destroyed.
  * tagmanager/css.c:
    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>

Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c	2008-10-13 15:26:41 UTC (rev 3075)
+++ trunk/src/plugins.c	2008-10-13 15:40:12 UTC (rev 3076)
@@ -662,12 +662,13 @@
 }
 
 
+/* Clean up anything used by an active plugin  */
 static void
-plugin_unload(Plugin *plugin)
+plugin_cleanup(Plugin *plugin)
 {
 	GtkWidget *widget;
 
-	if (is_active_plugin(plugin) && plugin->cleanup)
+	if (plugin->cleanup)
 		plugin->cleanup();
 
 	remove_callbacks(plugin);
@@ -679,7 +680,6 @@
 	if (widget)
 		gtk_widget_destroy(widget);
 
-	active_plugin_list = g_list_remove(active_plugin_list, plugin);
 	geany_debug("Unloaded: %s", plugin->filename);
 }
 
@@ -690,8 +690,11 @@
 	g_return_if_fail(plugin);
 	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))
 		g_warning("%s: %s", plugin->filename, g_module_error());
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list