* gtypemodule.c (g_type_module_use): Always reset the use count
to its previous value before returning FALSE. Pointed out by
Johan Billien.
svn path=/trunk/; revision=7725
+2008-12-02 Matthias Clasen <mclasen@redhat.com>
+
+ Bug 473150 – g_type_module_use inconsistently increases the use
+ counter in case of error
+
+ * gtypemodule.c (g_type_module_use): Always reset the use count
+ to its previous value before returning FALSE. Pointed out by
+ Johan Billien.
+
2008-12-01 Matthias Clasen <mclasen@redhat.com>
* === Released 2.19.2 ===
*
* Increases the use count of a #GTypeModule by one. If the
* use count was zero before, the plugin will be loaded.
+ * If loading the plugin fails, the use count is reset to
+ * its prior value.
*
* Returns: %FALSE if the plugin needed to be loaded and
* loading the plugin failed.
g_warning ("plugin '%s' failed to register type '%s'\n",
module->name ? module->name : "(unknown)",
g_type_name (type_info->type));
+ module->use_count--;
return FALSE;
}