[libpeas] Check if the created extension implements the interface.



commit e8474effc788cc490c2fcc85e61e5cb28a76619e
Author: Steve FrÃcinaux <code istique net>
Date:   Thu Jun 23 23:02:31 2011 +0200

    Check if the created extension implements the interface.
    
    The currently advertised way of using extensions is to use the
    implemented interface rather than the _call() method. So it's more
    important to ensure the returned object implements the rather than
    ensuring it is a PeasExtension instance.

 libpeas/peas-engine.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index e6f471e..3184a8d 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -1010,7 +1010,7 @@ peas_engine_create_extensionv (PeasEngine     *engine,
   extension = peas_plugin_loader_create_extension (loader, info, extension_type,
                                                    n_parameters, parameters);
 
-  if (!PEAS_IS_EXTENSION (extension))
+  if (!G_TYPE_CHECK_INSTANCE_TYPE (extension, extension_type))
     {
       g_warning ("Plugin '%s' does not provide a '%s' extension",
                  peas_plugin_info_get_module_name (info),



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