diff options
author | Karroffel <therzog@mail.de> | 2017-06-20 21:38:21 +0200 |
---|---|---|
committer | Karroffel <therzog@mail.de> | 2017-06-20 21:38:21 +0200 |
commit | 40bb90fabdbb98af9235b224d2172e4c1aeeacc9 (patch) | |
tree | 7b4777bc5612089789eb741f30efc333a40069de /core | |
parent | a22b9ce8aca9ff6580308b43bfaef92200f9aaa5 (diff) |
fixed ptrcall cast for const Ref<T>
Some methods require a const Ref<T> argument,
the ptrcall method wrappers cast `void *` to the
apropriate types. The problem is that there is no `Ref(const T *)`
constructor, but since Ref modifies the refcount of a Reference
anyway there's no point in a const version.
The problem is that with a `const T *` constructor call, the
argument gets converted to Variant first and loses all the
reference information, resulting in a null reference as the
argument to the constructor.
Diffstat (limited to 'core')
-rw-r--r-- | core/reference.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/reference.h b/core/reference.h index afc097817a..4e2d6c36c0 100644 --- a/core/reference.h +++ b/core/reference.h @@ -344,7 +344,7 @@ struct PtrToArg<const Ref<T> &> { _FORCE_INLINE_ static Ref<T> convert(const void *p_ptr) { - return Ref<T>(reinterpret_cast<const T *>(p_ptr)); + return Ref<T>((T *)p_ptr); } }; |