On Thu, 13 Mar 2008 15:19:16 +0100, Enrico Tröger enrico.troeger@uvena.de wrote:
To solve this problem, it might be best to unload each module after reading the information for each plugin - this would be good to do anyway to save memory. Otherwise, the shared library must stay resident. Each plugin's metadata could be cached by Geany.
Hmm, since non-active plugins (now) are only initialized when opening the plugin manager, I suggest to unload the modules (of inactive plugins) when closing the plugin manager instead of caching the metadata.
This would solve the problem of keeping modules resident in memory, but to fix the original global variable initialization problem, we also need to unload the module of any plugin disabled from the plugin manager, in case it is reloaded before the plugin manager is closed.
Oops, yes. And this would cause a rewrite of the already-loaded logic in the code ;-(.
Done in SVN r2355. Plugins now will be unloaded and afterwards loaded completely when toggled in the plugin manager. When the plugin state is "enabled" (toggled), then the plugin's init() function is called. This should solve the problem with static variables in plugins. I hope it works stable, I got tons of segfaults while changing the code ;-).
Regards, Enrico