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

Enrico Tröger enrico.troeger at xxxxx
Mon Mar 17 15:54:41 UTC 2008


On Thu, 13 Mar 2008 15:19:16 +0100, Enrico Tröger
<enrico.troeger at 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

-- 
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/20080317/fc3f30dc/attachment.pgp>


More information about the Users mailing list