diff options
Diffstat (limited to 'core/reference.cpp')
-rw-r--r-- | core/reference.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/reference.cpp b/core/reference.cpp index 5285888f78..e9629ee7c0 100644 --- a/core/reference.cpp +++ b/core/reference.cpp @@ -6,6 +6,7 @@ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -73,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; @@ -106,12 +108,12 @@ Variant WeakRef::get_ref() const { } void WeakRef::set_obj(Object *p_object) { - ref = p_object ? p_object->get_instance_ID() : 0; + ref = p_object ? p_object->get_instance_id() : 0; } void WeakRef::set_ref(const REF &p_ref) { - ref = p_ref.is_valid() ? p_ref->get_instance_ID() : 0; + ref = p_ref.is_valid() ? p_ref->get_instance_id() : 0; } WeakRef::WeakRef() { @@ -120,7 +122,7 @@ WeakRef::WeakRef() { void WeakRef::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_ref:Object"), &WeakRef::get_ref); + ClassDB::bind_method(D_METHOD("get_ref"), &WeakRef::get_ref); } #if 0 |