Add API to unload plugin module
authorPhilip Chimento <philip.chimento@gmail.com>
Fri, 2 Sep 2011 23:59:17 +0000 (01:59 +0200)
committerPhilip Chimento <philip.chimento@gmail.com>
Sun, 4 Sep 2011 20:00:24 +0000 (22:00 +0200)
This is a workaround for a very complicated bug. When you have more than
one ChimaraGlk widget opening the same plugin, then g_module_open()
doesn't dlopen() the plugin again; instead, it just adds a reference to
the open module.

This means that all static variables in the module are not reinitialized
when the Glk program starts running in the second ChimaraGlk widget.

This problem needs to be solved either by eliminating the static
variables from the plugins, or making sure that different ChimaraGlk
widgets open their plugins separately.

This commit does the latter, by adding API to unload the plugin module
(chimara_glk_unload_plugin()) so that ChimaraGlk widgets that run the
same program but not at the same time have the option to unload the
plugin in one widget before loading it in the other. Specifically, this
is the use case of Inform 7.

This does not fix the use case where two separate ChimaraGlk widgets
want to run the same program at the same time.


No differences found