mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
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.
This commit is contained in:
parent
a22b9ce8ac
commit
40bb90fabd
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user