[libpeas] Don't warn multiple times if _valist_to_parameter_list() fails



commit 11ed85c2b85dad4a499d4bb8d299db2774baed2e
Author: Garrett Regier <alias301 gmail com>
Date:   Fri Mar 4 22:46:28 2011 -0800

    Don't warn multiple times if _valist_to_parameter_list() fails

 libpeas/peas-engine.c        |    4 +++-
 libpeas/peas-extension-set.c |    5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index ac5e1cd..be848fb 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -1025,7 +1025,9 @@ peas_engine_create_extension_valist (PeasEngine     *engine,
   if (!_valist_to_parameter_list (extension_type, type_struct, first_property,
                                   var_args, &parameters, &n_parameters))
     {
-      g_return_val_if_reached (NULL);
+      /* Already warned */
+      _g_type_struct_unref (extension_type, type_struct);
+      return NULL;
     }
 
   exten = peas_engine_create_extensionv (engine, info, extension_type,
diff --git a/libpeas/peas-extension-set.c b/libpeas/peas-extension-set.c
index 6754af2..8f4b75b 100644
--- a/libpeas/peas-extension-set.c
+++ b/libpeas/peas-extension-set.c
@@ -631,8 +631,9 @@ peas_extension_set_new_valist (PeasEngine  *engine,
   if (!_valist_to_parameter_list (exten_type, type_struct, first_property,
                                   var_args, &parameters, &n_parameters))
     {
-      /* WARNING */
-      g_return_val_if_reached (NULL);
+      /* Already warned */
+      _g_type_struct_unref (exten_type, type_struct);
+      return NULL;
     }
 
   set = peas_extension_set_newv (engine, exten_type, n_parameters, parameters);



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