diff options
author | Garrett Regier <garrettregier@gmail.com> | 2011-09-18 05:50:02 -0700 |
---|---|---|
committer | Garrett Regier <garrettregier@gmail.com> | 2011-09-18 07:09:57 -0700 |
commit | 92fd9677c1ede8a2353842461b8f22a9a2f601ca (patch) | |
tree | 68f0f0bb4a666e301a9d470741d2a190e698931d | |
parent | 01e5bfdf3719adfc4bdf311c3d4145c811de8feb (diff) | |
download | libpeas-92fd9677c1ede8a2353842461b8f22a9a2f601ca.tar.gz |
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.
-rw-r--r-- | 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 |