Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Thu, 16 Nov 2023 09:56:02 UTC Commit: f3d466a359c9c501d815938602f24dff6ab622ff https://github.com/geany/geany/commit/f3d466a359c9c501d815938602f24dff6ab622...
Log Message: ----------- Avoid an easy-to-fix function cast
plugin_free_leaf() is only used as a GFunc, so make it be one.
Modified Paths: -------------- src/plugins.c
Modified: src/plugins.c 8 lines changed, 5 insertions(+), 3 deletions(-) =================================================================== @@ -1297,9 +1297,11 @@ void plugins_init(void)
/* Same as plugin_free(), except it does nothing for proxies-in-use, to be called on - * finalize in a loop */ -static void plugin_free_leaf(Plugin *p) + * finalize in a loop through g_list_foreach() */ +static void plugin_free_leaf(gpointer data, gpointer user_data G_GNUC_UNUSED) { + Plugin *p = data; + if (p->proxied_count == 0) plugin_free(p); } @@ -1315,7 +1317,7 @@ void plugins_finalize(void) /* Have to loop because proxys cannot be unloaded until after all their * plugins are unloaded as well (the second loop should should catch all the remaining ones) */ while (active_plugin_list != NULL) - g_list_foreach(active_plugin_list, (GFunc) plugin_free_leaf, NULL); + g_list_foreach(active_plugin_list, plugin_free_leaf, NULL);
g_strfreev(active_plugins_pref); }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).