Commit 9546ce79 authored by Matthias Clasen's avatar Matthias Clasen

css value: No need for atomic refcounting

We are all in one thread anyway.
parent fe1e2cbf
......@@ -48,7 +48,7 @@ _gtk_css_value_ref (GtkCssValue *value)
{
gtk_internal_return_val_if_fail (value != NULL, NULL);
g_atomic_int_add (&value->ref_count, 1);
value->ref_count += 1;
return value;
}
......@@ -59,7 +59,8 @@ _gtk_css_value_unref (GtkCssValue *value)
if (value == NULL)
return;
if (!g_atomic_int_dec_and_test (&value->ref_count))
value->ref_count -= 1;
if (value->ref_count > 0)
return;
value->class->free (value);
......
......@@ -35,7 +35,7 @@ typedef struct _GtkCssValueClass GtkCssValueClass;
/* using define instead of struct here so compilers get the packing right */
#define GTK_CSS_VALUE_BASE \
const GtkCssValueClass *class; \
volatile gint ref_count;
gint ref_count;
struct _GtkCssValueClass {
void (* free) (GtkCssValue *value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment