Move setting the refcount to the end of the function
authorEdward Hervey <bilboed@bilboed.com>
Thu, 24 Sep 2009 08:44:17 +0000 (10:44 +0200)
committerAlexander Larsson <alexl@redhat.com>
Mon, 30 Nov 2009 19:52:32 +0000 (20:52 +0100)
This is a safety feature for when making it atomic later.

https://bugzilla.gnome.org/show_bug.cgi?id=585375

gobject/gtype.c

index cd33770..07ed622 100644 (file)
@@ -1127,7 +1127,6 @@ type_data_make_W (TypeNode              *node,
     }
   
   node->data = data;
-  node->ref_count = 1;
   
   if (vtable_size)
     {
@@ -1158,6 +1157,8 @@ type_data_make_W (TypeNode              *node,
                                   GPOINTER_TO_UINT (type_get_qdata_L (node, static_quark_type_flags))));
   
   g_assert (node->data->common.value_table != NULL); /* paranoid */
+
+  node->ref_count = 1;
 }
 
 static inline void