summaryrefslogtreecommitdiff
path: root/core/object/reference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/object/reference.cpp')
-rw-r--r--core/object/reference.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/object/reference.cpp b/core/object/reference.cpp
index 22e4e8a336..086b761e95 100644
--- a/core/object/reference.cpp
+++ b/core/object/reference.cpp
@@ -62,6 +62,9 @@ bool Reference::reference() {
if (get_script_instance()) {
get_script_instance()->refcount_incremented();
}
+ if (_get_extension() && _get_extension()->reference) {
+ _get_extension()->reference(_get_extension_instance());
+ }
if (instance_binding_count.get() > 0 && !ScriptServer::are_languages_finished()) {
for (int i = 0; i < MAX_SCRIPT_INSTANCE_BINDINGS; i++) {
if (_script_instance_bindings[i]) {
@@ -83,6 +86,9 @@ bool Reference::unreference() {
bool script_ret = get_script_instance()->refcount_decremented();
die = die && script_ret;
}
+ if (_get_extension() && _get_extension()->unreference) {
+ _get_extension()->unreference(_get_extension_instance());
+ }
if (instance_binding_count.get() > 0 && !ScriptServer::are_languages_finished()) {
for (int i = 0; i < MAX_SCRIPT_INSTANCE_BINDINGS; i++) {
if (_script_instance_bindings[i]) {