plugins: separate geany_plugin_set_data() dual-use
commit437837d3a54367393c41d6c1e1f4d1af4481627e
authorThomas Martitz <kugel@rockbox.org>
Sun, 23 Aug 2015 13:23:37 +0000 (23 15:23 +0200)
committerThomas Martitz <kugel@rockbox.org>
Sun, 23 Aug 2015 18:01:42 +0000 (23 20:01 +0200)
tree2e27d29af12f844d424ac89a3a867cd0d08091c9
parentd54b65b9ac6d981a7f770abfb11f6dba2e875e2c
plugins: separate geany_plugin_set_data() dual-use

It was found that because geany_plugin_set_data() could be used by both
plugin's init() and geany_load_module(), that it introduced some uncertainty
as to when to call the free_func. init() callers might expect the call
around the same time as cleanup() is called, while geany_load_module()
callers expected the call at module unload time.

It was indeed called at module unload time. But that means that init() callers
cannot call it again reliably after in a init()->cleanup()->init() flow (when
toggling the plugin) without fully unloading the plugin (which is what we do
currently but that's we would want to change).

With the separation we can actually destroy the data depending on where
it was set and do everything unambigiously.
doc/plugins.dox
src/plugindata.h
src/pluginprivate.h
src/plugins.c
src/pluginutils.c