summaryrefslogtreecommitdiff
path: root/core/object/ref_counted.cpp
diff options
context:
space:
mode:
authorIgnacio Roldán Etcheverry <ignalfonsore@gmail.com>2022-08-12 08:38:33 +0200
committerIgnacio Roldán Etcheverry <ignalfonsore@gmail.com>2022-08-12 08:43:53 +0200
commitf45f20285c33584d0887588eb33de78ff1fd16c3 (patch)
tree860f4343730148f5f574cddaaf995b8612aa0266 /core/object/ref_counted.cpp
parentc2eaaef1497f8ad557aea9a14e2b3e0582fcfe54 (diff)
Fix instance binding unreference callback regression
This was a regression from 44691448911f1d29d4d79dbdd5553734761e57c4 The callback should be called, not only be called when the refcount reaches 0. For example, the C# callback needs to know when the refcount reaches 1, in order to swap to a weak GC handle.
Diffstat (limited to 'core/object/ref_counted.cpp')
-rw-r--r--core/object/ref_counted.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/object/ref_counted.cpp b/core/object/ref_counted.cpp
index 726e2c012c..cac2400744 100644
--- a/core/object/ref_counted.cpp
+++ b/core/object/ref_counted.cpp
@@ -85,7 +85,8 @@ bool RefCounted::unreference() {
_get_extension()->unreference(_get_extension_instance());
}
- die = die && _instance_binding_reference(false);
+ bool binding_ret = _instance_binding_reference(false);
+ die = die && binding_ret;
}
return die;