summaryrefslogtreecommitdiff
path: root/gdk/gdkcursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdk/gdkcursor.c')
-rw-r--r--gdk/gdkcursor.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c
index bdea57b5ed..1750fcdc1e 100644
--- a/gdk/gdkcursor.c
+++ b/gdk/gdkcursor.c
@@ -30,7 +30,10 @@
GdkCursor*
gdk_cursor_ref (GdkCursor *cursor)
{
- cursor->refcount += 1;
+ g_return_val_if_fail (cursor != NULL, NULL);
+ g_return_val_if_fail (cursor->ref_count > 0, NULL);
+
+ cursor->ref_count += 1;
return cursor;
}
@@ -39,11 +42,11 @@ void
gdk_cursor_unref (GdkCursor *cursor)
{
g_return_if_fail (cursor != NULL);
- g_return_if_fail (cursor->refcount > 0);
+ g_return_if_fail (cursor->ref_count > 0);
- cursor->refcount -= 1;
+ cursor->ref_count -= 1;
- if (cursor->refcount == 0)
- _gdk_cursor_destroy(cursor);
+ if (cursor->ref_count == 0)
+ _gdk_cursor_destroy (cursor);
}