summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Regier <garrettregier@gmail.com>2015-11-20 02:44:09 -0800
committerGarrett Regier <garrettregier@gmail.com>2015-12-15 16:57:46 -0800
commitf6dac8247dad2a8f684c9598cf1a454fba7ee902 (patch)
treee22c79dc23b610ce6fd754bc325bd841ed0b3168
parent8f94bf5d5caa8ec8961fecf5c4b20ae0393d62e8 (diff)
downloadlibpeas-f6dac8247dad2a8f684c9598cf1a454fba7ee902.tar.gz
Be more strict in peas_object_module_register_extension_type()
Before it was possible to specify that the iface_type was that of PeasPluginLoader and bypass the check that the extensin type is of the iface_type.
-rw-r--r--libpeas/peas-object-module.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libpeas/peas-object-module.c b/libpeas/peas-object-module.c
index fb6f975..68cb43a 100644
--- a/libpeas/peas-object-module.c
+++ b/libpeas/peas-object-module.c
@@ -564,12 +564,10 @@ peas_object_module_register_extension_type (PeasObjectModule *module,
{
g_return_if_fail (PEAS_IS_OBJECT_MODULE (module));
g_return_if_fail (!peas_object_module_provides_object (module, iface_type));
+ g_return_if_fail (g_type_is_a (extension_type, iface_type));
if (iface_type != PEAS_TYPE_PLUGIN_LOADER)
- {
- g_return_if_fail (G_TYPE_IS_INTERFACE (iface_type));
- g_return_if_fail (g_type_is_a (extension_type, iface_type));
- }
+ g_return_if_fail (G_TYPE_IS_INTERFACE (iface_type));
peas_object_module_register_extension_factory (module,
iface_type,