diff options
Diffstat (limited to 'core/reference.cpp')
-rw-r--r-- | core/reference.cpp | 45 |
1 files changed, 2 insertions, 43 deletions
diff --git a/core/reference.cpp b/core/reference.cpp index e9629ee7c0..bb70628cbe 100644 --- a/core/reference.cpp +++ b/core/reference.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -98,7 +98,7 @@ Variant WeakRef::get_ref() const { Object *obj = ObjectDB::get_instance(ref); if (!obj) return Variant(); - Reference *r = obj->cast_to<Reference>(); + Reference *r = cast_to<Reference>(obj); if (r) { return REF(r); @@ -124,44 +124,3 @@ void WeakRef::_bind_methods() { ClassDB::bind_method(D_METHOD("get_ref"), &WeakRef::get_ref); } -#if 0 - -Reference * RefBase::get_reference_from_ref(const RefBase &p_base) { - - return p_base.get_reference(); -} -void RefBase::ref_inc(Reference *p_reference) { - - p_reference->refcount.ref(); -} -bool RefBase::ref_dec(Reference *p_reference) { - - bool ref = p_reference->refcount.unref(); - return ref; -} - -Reference *RefBase::first_ref(Reference *p_reference) { - - if (p_reference->refcount.ref()) { - - // this may fail in the scenario of two threads assigning the pointer for the FIRST TIME - // at the same time, which is never likely to happen (would be crazy to do) - // so don't do it. - - if (p_reference->refcount_init.get()>0) { - p_reference->refcount_init.unref(); - p_reference->refcount.unref(); // first referencing is already 1, so compensate for the ref above - } - - return p_reference; - } else { - - return 0; - } - -} -char * RefBase::get_refptr_data(const RefPtr &p_refptr) const { - - return p_refptr.data; -} -#endif |