Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Fri, 06 Sep 2024 19:17:38 UTC Commit: e53025edabe3d921374a163fe51ff5f0560d7065 https://github.com/geany/geany/commit/e53025edabe3d921374a163fe51ff5f0560d70...
Log Message: ----------- Don't call plugin extension functions when quitting or closing all files
Plugins may need to call the _provided() function e.g. inside Scintilla event handler which can get called for every file when batch-closing a session. For the LSP plugin, the _provided() call then keeps starting the server even though it should be terminated when closing project or quitting Geany.
Modified Paths: -------------- src/pluginextension.c
Modified: src/pluginextension.c 5 lines changed, 5 insertions(+), 0 deletions(-) =================================================================== @@ -21,6 +21,7 @@ #include "pluginextension.h"
#include "editor.h" +#include "main.h"
typedef struct @@ -143,6 +144,8 @@ void plugin_extension_unregister(PluginExtension *extension) */ #define CALL_PROVIDED(f, doc, ext) \ G_STMT_START { \ + if (main_status.quitting || main_status.closing_all) \ + return FALSE; \ for (GList *node = all_extensions; node; node = node->next) \ { \ PluginExtensionEntry *entry = node->data; \ @@ -167,6 +170,8 @@ void plugin_extension_unregister(PluginExtension *extension) */ #define CALL_PERFORM(f_provided, doc, f_perform, args, defret) \ G_STMT_START { \ + if (main_status.quitting || main_status.closing_all) \ + return defret; \ for (GList *node = all_extensions; node; node = node->next) \ { \ PluginExtensionEntry *entry = node->data; \
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).