aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-module.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-08-05 21:41:27 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:08:45 +0800
commit16a1a544236682b25f906ca07fc6aafb62f85994 (patch)
tree9d382d47afc20cb6e2891d83eb1131aef15576d1 /e-util/e-module.c
parent552090e63f8057cea57843ac79f5bfeec8d19861 (diff)
downloadgsoc2013-evolution-16a1a544236682b25f906ca07fc6aafb62f85994.tar
gsoc2013-evolution-16a1a544236682b25f906ca07fc6aafb62f85994.tar.gz
gsoc2013-evolution-16a1a544236682b25f906ca07fc6aafb62f85994.tar.bz2
gsoc2013-evolution-16a1a544236682b25f906ca07fc6aafb62f85994.tar.lz
gsoc2013-evolution-16a1a544236682b25f906ca07fc6aafb62f85994.tar.xz
gsoc2013-evolution-16a1a544236682b25f906ca07fc6aafb62f85994.tar.zst
gsoc2013-evolution-16a1a544236682b25f906ca07fc6aafb62f85994.zip
EModule: Make all modules resident.
Works around a design flaw in EExtension. See the comment in e-module.c for more details.
Diffstat (limited to 'e-util/e-module.c')
-rw-r--r--e-util/e-module.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/e-util/e-module.c b/e-util/e-module.c
index b3e90aac72..46486080d6 100644
--- a/e-util/e-module.c
+++ b/e-util/e-module.c
@@ -139,6 +139,25 @@ module_load (GTypeModule *type_module)
priv->load (type_module);
+ /* XXX This is a Band-Aid for a design flaw in EExtension. If the
+ * "extensible_type" member of EExtensionClass is set to a GType
+ * that hasn't already been registered, then when the extension's
+ * module is unloaded the GType registration that was triggered
+ * by setting "extensible_type" will be invalidated and cause
+ * Evolution to malfunction when the module is loaded again.
+ *
+ * Extension modules get loaded and unloaded repeatedly by
+ * e_extensible_load_extensions(), which temporarily references
+ * all extension classes and picks out the ones it needs for a
+ * given EExtensible instance based on the "extensible_type"
+ * class member.
+ *
+ * Making the module resident prevents the aforementioned GType
+ * registration from being invalidated when the extension class
+ * is unreferenced.
+ */
+ g_module_make_resident (priv->module);
+
return TRUE;
fail: