[libpeas] Fix the Seed plugin loader when extensions is not an object



commit 92fd9677c1ede8a2353842461b8f22a9a2f601ca
Author: Garrett Regier <garrettregier gmail com>
Date:   Sun Sep 18 05:50:02 2011 -0700

    Fix the Seed plugin loader when extensions is not an object
    
    Before if the extensions was not an object it would not warn
    and would return TRUE which could later cause a seg fault.

 loaders/seed/peas-plugin-loader-seed.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/loaders/seed/peas-plugin-loader-seed.c b/loaders/seed/peas-plugin-loader-seed.c
index 9c3fc0a..ec4f94f 100644
--- a/loaders/seed/peas-plugin-loader-seed.c
+++ b/loaders/seed/peas-plugin-loader-seed.c
@@ -105,15 +105,18 @@ peas_plugin_loader_seed_load (PeasPluginLoader *loader,
       sinfo = (SeedInfo *) g_slice_new (SeedInfo);
       sinfo->context = context;
       sinfo->extensions = extensions;
-      seed_context_ref (context);
       seed_value_protect (context, extensions);
 
       g_hash_table_insert (sloader->loaded_plugins, info, sinfo);
+      return TRUE;
+    }
+  else
+    {
+      g_warning ("extensions is not an object in plugin '%s'",
+                 peas_plugin_info_get_module_name (info));
+      seed_context_unref (context);
+      return FALSE;
     }
-
-  seed_context_unref (context);
-
-  return TRUE;
 }
 
 static gboolean



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