diff --git a/core/include/blue/core/object.h b/core/include/blue/core/object.h index fedf1c3..c8d62d7 100644 --- a/core/include/blue/core/object.h +++ b/core/include/blue/core/object.h @@ -24,8 +24,8 @@ BLUE_API void *b_object_get_private(b_object *object, b_type type); BLUE_API void *b_object_get_protected(b_object *object, b_type type); BLUE_API void *b_object_get_interface(b_object *object, b_type type); -b_object *b_retain(b_object *p); -BLUE_API void b_release(b_object *p); +BLUE_API b_object *b_object_ref(b_object *p); +BLUE_API void b_object_unref(b_object *p); BLUE_API b_object *b_object_create(b_type type); BLUE_API void b_object_to_string(b_object *p, struct b_stream *out); diff --git a/core/object.c b/core/object.c index 5e06dac..6ebb610 100644 --- a/core/object.c +++ b/core/object.c @@ -108,16 +108,17 @@ void *b_object_get_interface(struct _b_object *object, b_type type) return z__b_class_get_interface(object->obj_type->r_class, type); } -struct _b_object *b_retain(struct _b_object *p) +struct _b_object *b_object_ref(struct _b_object *p) { p->obj_ref++; return p; } -void b_release(struct _b_object *p) +void b_object_unref(struct _b_object *p) { if (p->obj_ref > 1) { p->obj_ref--; + return; } p->obj_ref = 0;