diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-10 16:42:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-10 16:42:31 +0200 |
commit | 46beaacec3d18c0d5f1d744e2c63ca09f5152c85 (patch) | |
tree | e9520a708f1a8f65a829547c281f1cbedf38cca8 /core/variant/variant.h | |
parent | 50d5569ad49752803b980eca85590f5362b12409 (diff) | |
parent | ee6e05ee68afc7841848382fbd538fdf7369b214 (diff) |
Merge pull request #51017 from vnen/extension-fixes
Diffstat (limited to 'core/variant/variant.h')
-rw-r--r-- | core/variant/variant.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/variant/variant.h b/core/variant/variant.h index 780f9b4e70..9ec131a1b8 100644 --- a/core/variant/variant.h +++ b/core/variant/variant.h @@ -208,7 +208,7 @@ private: Transform3D *_transform3d; PackedArrayRefBase *packed_array; void *_ptr; //generic pointer - uint8_t _mem[sizeof(ObjData) > (sizeof(real_t) * 4) ? sizeof(ObjData) : (sizeof(real_t) * 4)]; + uint8_t _mem[sizeof(ObjData) > (sizeof(real_t) * 4) ? sizeof(ObjData) : (sizeof(real_t) * 4)]{ 0 }; } _data alignas(8); void reference(const Variant &p_variant); @@ -271,6 +271,8 @@ private: static void _register_variant_setters_getters(); static void _unregister_variant_setters_getters(); static void _register_variant_constructors(); + static void _unregister_variant_destructors(); + static void _register_variant_destructors(); static void _unregister_variant_constructors(); static void _register_variant_utility_functions(); static void _unregister_variant_utility_functions(); @@ -534,6 +536,14 @@ public: static void get_constructor_list(Type p_type, List<MethodInfo> *r_list); //convenience + /* Destructors */ + + // Only ptrcall is available. + typedef void (*PTRDestructor)(void *base); + + static PTRDestructor get_ptr_destructor(Variant::Type p_type); + static bool has_destructor(Variant::Type p_type); + /* Properties */ void set_named(const StringName &p_member, const Variant &p_value, bool &r_valid); |