mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 15:26:37 +02:00
core: auto-purge plugin contributions on plugin unload
Call theme_unregister_plugin (plugin) from plugin_remove, right after config_file_free_all_plugin and before unhook_all_plugin. This drops every theme contribution whose plugin pointer matches the plugin being unloaded, so subsequent /theme apply runs no longer try to set options for an unloaded plugin and per-plugin contributions don't outlive the plugin. Script-owned contributions (plugin != NULL && script != NULL) are left intact - they are cleaned up per-script in the next commit. This commit is wiring only: the underlying theme_unregister_plugin function and its semantics are already covered by TEST(CoreTheme, UnregisterByOwner) in the previous commit.
This commit is contained in:
@@ -1217,6 +1217,9 @@ plugin_remove (struct t_weechat_plugin *plugin)
|
||||
/* remove all configuration files */
|
||||
config_file_free_all_plugin (plugin);
|
||||
|
||||
/* remove all theme contributions registered by this plugin */
|
||||
theme_unregister_plugin (plugin);
|
||||
|
||||
/* remove all hooks */
|
||||
unhook_all_plugin (plugin, NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user