[libpeas] Don't return NULL in the constructor



commit 7ae32dc70c0eca049257973bd4172d36acc559a6
Author: Garrett Regier <alias301 gmail com>
Date:   Wed Feb 9 01:14:52 2011 -0800

    Don't return NULL in the constructor
    
    Instead use g_error() which aborts the program

 libpeas/peas-engine.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index a4ad0a0..e59e8c8 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -340,16 +340,14 @@ peas_engine_constructor (GType                  type,
   /* We don't support calling PeasEngine API without module support */
   if (!g_module_supported ())
     {
-      g_warning ("libpeas is not able to create the "
-                 "plugins engine as modules are not supported.");
-      return NULL;
+      g_error ("libpeas is not able to create the "
+               "plugins engine as modules are not supported.");
     }
 
   if (shutdown)
     {
-      g_warning ("libpeas cannot create a plugin engine "
-                 "as it has been shutdown.");
-      return NULL;
+      g_error ("libpeas cannot create a plugin engine "
+               "as it has been shutdown.");
     }
 
   if (default_engine != NULL)



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