summaryrefslogtreecommitdiff
path: root/core/object
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-22 08:26:29 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-22 08:26:29 +0200
commitd96b7d767a1f7f8a5be37b80077e276bb174005f (patch)
treef0ad5330db2bed03b60908cde9d5da224ab8e915 /core/object
parent2d598bbf9aa47ab80300d64203af8ddd7e542bb0 (diff)
parent474cee7dafa4df94294de3e1c45e049defd7cfc5 (diff)
Merge pull request #66110 from Zylann/reference_get_count
get_reference_count()`
Diffstat (limited to 'core/object')
-rw-r--r--core/object/ref_counted.cpp3
-rw-r--r--core/object/ref_counted.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/core/object/ref_counted.cpp b/core/object/ref_counted.cpp
index cac2400744..50467d795d 100644
--- a/core/object/ref_counted.cpp
+++ b/core/object/ref_counted.cpp
@@ -48,9 +48,10 @@ void RefCounted::_bind_methods() {
ClassDB::bind_method(D_METHOD("init_ref"), &RefCounted::init_ref);
ClassDB::bind_method(D_METHOD("reference"), &RefCounted::reference);
ClassDB::bind_method(D_METHOD("unreference"), &RefCounted::unreference);
+ ClassDB::bind_method(D_METHOD("get_reference_count"), &RefCounted::get_reference_count);
}
-int RefCounted::reference_get_count() const {
+int RefCounted::get_reference_count() const {
return refcount.get();
}
diff --git a/core/object/ref_counted.h b/core/object/ref_counted.h
index bd06a84bd8..71790fb825 100644
--- a/core/object/ref_counted.h
+++ b/core/object/ref_counted.h
@@ -47,7 +47,7 @@ public:
bool init_ref();
bool reference(); // returns false if refcount is at zero and didn't get increased
bool unreference();
- int reference_get_count() const;
+ int get_reference_count() const;
RefCounted();
~RefCounted() {}