| 41 | #include "core/object/script_language.h" |
| 42 | |
| 43 | bool RefCounted::init_ref() { |
| 44 | if (reference()) { |
| 45 | if (!is_referenced() && refcount_init.unref()) { |
| 46 | unreference(); // first referencing is already 1, so compensate for the ref above |
| 47 | } |
| 48 | |
| 49 | return true; |
| 50 | } else { |
| 51 | return false; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | void RefCounted::_bind_methods() { |
| 56 | ClassDB::bind_method(D_METHOD("init_ref"), &RefCounted::init_ref); |
no test coverage detected