[libpeas] Avoid a double unref and a possible unallowed unref



commit 0d7a4176a0162568bf5a47e1cf90c5791c87caf1
Author: Garrett Regier <garrettregier gmail com>
Date:   Sun Sep 18 06:08:19 2011 -0700

    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.

 libpeas/peas-engine.c |    5 +----
 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;
     }



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