[libpeas] Fix peas_engine_get_loaded_plugins() when there are not plugins.



commit a02e8a1c6612d41c40608c93fc83ff667f3ae4a3
Author: Garrett Regier <alias301 gmail com>
Date:   Thu Dec 9 09:33:27 2010 -0800

    Fix peas_engine_get_loaded_plugins() when there are not plugins.
    
    Before would return non-NULL junk now it returns NULL.

 libpeas/peas-engine.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index d387522..f62e154 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -1054,7 +1054,16 @@ peas_engine_get_loaded_plugins (PeasEngine *engine)
         }
     }
 
-  return (gchar **) g_array_free (array, FALSE);
+  /* Bug in GArray? */
+  if (array->len == 0)
+    {
+      g_array_free (array, TRUE);
+      return NULL;
+    }
+  else
+    {
+      return (gchar **) g_array_free (array, FALSE);
+    }
 }
 
 static gboolean



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