gs-plugin: Make plugins resident so they can’t be unloaded
Otherwise the unit tests fail when reloading the plugins for the first
time, as the static type variable in (for example)
gs_plugin_flatpak_get_type()
is re-initialised to zero, causing the
GsPluginFlatpak
type to be re-registered with GObject — but GObject
rejects that as GsPluginFlatpak
has already been registered.
This should fix the unit tests, and shouldn’t affect the behaviour of the normal application, because plugins are never unloaded by it except at shutdown time. (Even plugins which fail setup are disabled but not unloaded.)
This bug is only visible when compiling with valgrind support disabled:
when valgrind support is enabled, g_module_close()
is never called on
a GsPlugin
, which has a similar effect.
Signed-off-by: Philip Withnall pwithnall@endlessos.org