If loading the module fails, don't increment the use count.
authorOwen Taylor <otaylor@redhat.com>
Thu, 16 Nov 2000 16:09:47 +0000 (16:09 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Thu, 16 Nov 2000 16:09:47 +0000 (16:09 +0000)
Wed Nov 15 20:58:05 2000  Owen Taylor  <otaylor@redhat.com>

* gtypemodule.c (g_type_module_use): If loading the
module fails, don't increment the use count.

gobject/ChangeLog
gobject/gtypemodule.c

index 0cb5c6a4c66e8f0b5961832d181cf197b09ef9de..0911c3aede5c7e9e5b5a8d1fdf69352719fc990c 100644 (file)
@@ -1,3 +1,8 @@
+Wed Nov 15 20:58:05 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtypemodule.c (g_type_module_use): If loading the
+       module fails, don't increment the use count.
+
 Thu Nov  9 01:49:43 2000  Tim Janik  <timj@gtk.org>
 
        * gobject.h (G_WARN_INVALID_PARAM_ID): doh,
index 4e5848e9045df0ddf9db745765971e6c7a89f428..cef74999b113fbed13f406ed9fa5c2b2ea2d0533 100644 (file)
@@ -204,7 +204,10 @@ g_type_module_use (GTypeModule *module)
       GSList *tmp_list;
       
       if (!G_TYPE_MODULE_GET_CLASS (module)->load (module))
-       return FALSE;
+       {
+         module->use_count--;
+         return FALSE;
+       }
 
       tmp_list = module->type_infos;
       while (tmp_list)