1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Forward refcount changes to NativeScriptInstance

This also changes Reference::unreference() to always invoke
refcount_decremented. Previously it was not invoked until the count
reached zero due to short-circuit evalution of boolean expressions.
This commit is contained in:
Ruslan Mustakov
2017-07-26 20:24:15 +07:00
parent f55211ae0d
commit db9dcbddbc
3 changed files with 27 additions and 1 deletions

View File

@@ -74,7 +74,8 @@ bool Reference::unreference() {
bool die = refcount.unref();
if (get_script_instance()) {
die = die && get_script_instance()->refcount_decremented();
bool script_ret = get_script_instance()->refcount_decremented();
die = die && script_ret;
}
return die;