[Geany] Unloading modules (was Re: Plugin keybindings support in SVN)

Enrico Tröger enrico.troeger at xxxxx
Thu Mar 13 14:19:16 UTC 2008


On Thu, 13 Mar 2008 14:00:54 +0000, Nick Treleaven
<nick.treleaven at btinternet.com> wrote:

> On Thu, 13 Mar 2008 14:36:26 +0100
> Enrico Tröger <enrico.troeger at uvena.de> wrote:
> 
> > On Thu, 13 Mar 2008 13:10:37 +0000, Nick Treleaven
> > <nick.treleaven at btinternet.com> wrote:
> > 
> > > Thanks, this might reveal some similar problems in other plugins.
> > > Since the plugin manager was added, it seems each GModule is loaded
> > > at startup, but not initialized. This means each plugin's global
> > > variables are only initialized at startup, not when they are
> > > enabled.
> > Not anymore ;-).
> > This morning,  I changed the code to only initialize "active" plugins.
> > "active" means plugins which were enabled by the user. All other
> > plugins are not read at all at startup of Geany but only if the plugin
> > manager is loaded.
> 
> Cool, I hadn't checked latest SVN ;-)
> 
> > > 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 ;-(.

Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20080313/e2685a81/attachment.pgp>


More information about the Users mailing list