[glib/gobject-performance] Move setting the refcount to the end of the function



commit 28c872d5e5f036b37a151d05619e7dd94cd35fbc
Author: Edward Hervey <bilboed bilboed com>
Date:   Thu Sep 24 10:44:17 2009 +0200

    Move setting the refcount to the end of the function
    
    This is a safety feature for when making it atomic later.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=585375

 gobject/gtype.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 307f8ef..85b1460 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -1125,7 +1125,6 @@ type_data_make_W (TypeNode              *node,
     }
   
   node->data = data;
-  node->ref_count = 1;
   
   if (vtable_size)
     {
@@ -1156,6 +1155,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



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