| 64 | } |
| 65 | |
| 66 | bool RefCounted::reference() { |
| 67 | uint32_t rc_val = refcount.refval(); |
| 68 | bool success = rc_val != 0; |
| 69 | |
| 70 | if (success && rc_val <= 2 /* higher is not relevant */) { |
| 71 | if (get_script_instance()) { |
| 72 | get_script_instance()->refcount_incremented(); |
| 73 | } |
| 74 | if (_get_extension() && _get_extension()->reference) { |
| 75 | _get_extension()->reference(_get_extension_instance()); |
| 76 | } |
| 77 | |
| 78 | _instance_binding_reference(true); |
| 79 | } |
| 80 | |
| 81 | return success; |
| 82 | } |
| 83 | |
| 84 | bool RefCounted::unreference() { |
| 85 | uint32_t rc_val = refcount.unrefval(); |
no test coverage detected