[libpeas] Fixed the way seed plugin asks for an extension point



commit 79bc9ec8bc36d0aea20ea6303c2e70db209720aa
Author: Jonh Wendell <jwendell gnome org>
Date:   Mon Sep 6 15:25:07 2010 -0300

    Fixed the way seed plugin asks for an extension point
    
    We explicitly check if the plugin provides an seed object,
    because it was returning the 'undefined' value.

 loaders/seed/peas-plugin-loader-seed.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/loaders/seed/peas-plugin-loader-seed.c b/loaders/seed/peas-plugin-loader-seed.c
index 0da91a6..73a303e 100644
--- a/loaders/seed/peas-plugin-loader-seed.c
+++ b/loaders/seed/peas-plugin-loader-seed.c
@@ -140,7 +140,7 @@ peas_plugin_loader_seed_provides_extension  (PeasPluginLoader *loader,
 {
   PeasPluginLoaderSeed *sloader = PEAS_PLUGIN_LOADER_SEED (loader);
   SeedInfo *sinfo;
-  SeedObject *extension;
+  SeedValue extension;
 
   sinfo = (SeedInfo *) g_hash_table_lookup (sloader->loaded_plugins, info);
   if (!sinfo)
@@ -149,7 +149,7 @@ peas_plugin_loader_seed_provides_extension  (PeasPluginLoader *loader,
   extension = seed_object_get_property (sinfo->context,
                                         sinfo->extensions,
                                         g_type_name (exten_type));
-  return extension != NULL;
+  return extension && seed_value_is_object (sinfo->context, extension);
 }
 
 static PeasExtension *
@@ -173,7 +173,7 @@ peas_plugin_loader_seed_create_extension (PeasPluginLoader *loader,
   extension_methods = seed_object_get_property (sinfo->context,
                                                 sinfo->extensions,
                                                 g_type_name (exten_type));
-  if (!extension_methods)
+  if (!extension_methods || seed_value_is_undefined (sinfo->context, extension_methods) || seed_value_is_null (sinfo->context, extension_methods))
     return NULL;
 
   if (!seed_value_is_object (sinfo->context, extension_methods))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]