Fix refactored Object::cast_to in NO_SAFE_CAST branch

This commit is contained in:
Henrik Andersson 2017-08-26 17:10:58 +02:00
parent dd7145b778
commit 3cd3c1da5f
2 changed files with 4 additions and 4 deletions

View File

@ -571,8 +571,8 @@ public:
#else #else
if (!p_object) if (!p_object)
return NULL; return NULL;
if (p_pobject->is_class_ptr(T::get_class_ptr_static())) if (p_object->is_class_ptr(T::get_class_ptr_static()))
return static_cast<T *>(p_pobject); return static_cast<T *>(p_object);
else else
return NULL; return NULL;
#endif #endif
@ -591,7 +591,7 @@ public:
#else #else
if (!p_object) if (!p_object)
return NULL; return NULL;
if (p_pobject->is_class_ptr(T::get_class_ptr_static())) if (p_object->is_class_ptr(T::get_class_ptr_static()))
return static_cast<const T *>(p_object); return static_cast<const T *>(p_object);
else else
return NULL; return NULL;

View File

@ -112,7 +112,7 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method,
Ref<Reference> ref = *p_args[i]; Ref<Reference> ref = *p_args[i];
if (!ref.is_null()) { if (!ref.is_null()) {
if (Object::cast_to<JavaObject>(ref)) { if (Object::cast_to<JavaObject>(ref.ptr())) {
Ref<JavaObject> jo = ref; Ref<JavaObject> jo = ref;
//could be faster //could be faster