summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-04-01 11:36:17 +0200
committerGitHub <noreply@github.com>2023-04-01 11:36:17 +0200
commite9942db502435a988c64dfdb793eb475563863b8 (patch)
tree5fa07b036cfc0121283980de109f3d8a1df025aa
parent9d1c396c54fc3bdfcc7da4f3abcb52b14f6cce8f (diff)
parent093f0673f53a5fe9bc19f98c8ba511cc04f9f877 (diff)
downloadredot-cpp-e9942db502435a988c64dfdb793eb475563863b8.tar.gz
Merge pull request #1044 from zhehangd/fix_obj_ptr_crash
Fix crash using Object* as parameter
-rw-r--r--include/godot_cpp/core/method_ptrcall.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/godot_cpp/core/method_ptrcall.hpp b/include/godot_cpp/core/method_ptrcall.hpp
index 6b092bb..6a5227a 100644
--- a/include/godot_cpp/core/method_ptrcall.hpp
+++ b/include/godot_cpp/core/method_ptrcall.hpp
@@ -168,7 +168,9 @@ MAKE_PTRARG_BY_REFERENCE(Variant);
template <class T>
struct PtrToArg<T *> {
_FORCE_INLINE_ static T *convert(const void *p_ptr) {
- return reinterpret_cast<T *>(godot::internal::gde_interface->object_get_instance_binding(*reinterpret_cast<GDExtensionObjectPtr *>(const_cast<void *>(p_ptr)), godot::internal::token, &T::___binding_callbacks));
+ return reinterpret_cast<T *>(godot::internal::gde_interface->object_get_instance_binding(
+ reinterpret_cast<GDExtensionObjectPtr>(const_cast<void *>(p_ptr)),
+ godot::internal::token, &T::___binding_callbacks));
}
typedef Object *EncodeT;
_FORCE_INLINE_ static void encode(T *p_var, void *p_ptr) {
@@ -179,7 +181,9 @@ struct PtrToArg<T *> {
template <class T>
struct PtrToArg<const T *> {
_FORCE_INLINE_ static const T *convert(const void *p_ptr) {
- return reinterpret_cast<const T *>(godot::internal::gde_interface->object_get_instance_binding(*reinterpret_cast<GDExtensionObjectPtr *>(const_cast<void *>(p_ptr)), godot::internal::token, &T::___binding_callbacks));
+ return reinterpret_cast<const T *>(godot::internal::gde_interface->object_get_instance_binding(
+ reinterpret_cast<GDExtensionObjectPtr>(const_cast<void *>(p_ptr)),
+ godot::internal::token, &T::___binding_callbacks));
}
typedef const Object *EncodeT;
_FORCE_INLINE_ static void encode(T *p_var, void *p_ptr) {