From 4044961478934c4acd8e74efc68ddf9421af274a Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 18 Oct 2025 21:51:51 +0100 Subject: [PATCH] core: rename b_retain/b_release to b_object_ref/b_object_unref --- core/include/blue/core/object.h | 4 ++-- core/object.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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;