summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Regier <garrettregier@gmail.com>2011-09-18 06:08:19 -0700
committerGarrett Regier <garrettregier@gmail.com>2011-09-18 07:09:57 -0700
commit0d7a4176a0162568bf5a47e1cf90c5791c87caf1 (patch)
tree703b6d33d5edadcc949854384cc7f1e0fa5c6bcf
parent3f5736547aea71856792aeb1930ea273c9862aef (diff)
downloadlibpeas-0d7a4176a0162568bf5a47e1cf90c5791c87caf1.tar.gz
Avoid a double unref and a possible unallowed unref
The unallowed unref comes from the GTypeModule and the fact that it cannot be unreffed after certain things happen but the documentation is not specific about it.
-rw-r--r--libpeas/peas-engine.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index 2ea9ffa..1adf4ff 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -661,10 +661,7 @@ get_plugin_loader (PeasEngine *engine,
g_warning ("Loader '%s' is not a valid PeasPluginLoader instance",
info->loader);
- if (G_IS_OBJECT (loader_info->loader))
- g_object_unref (loader_info->loader);
-
- g_object_unref (loader_info->module);
+ /* This will cause the loader to be unreffed if it exists */
g_hash_table_insert (loaders, g_strdup (info->loader), NULL);
return NULL;
}