diff options
author | David Snopek <dsnopek@gmail.com> | 2024-10-17 16:05:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-17 16:05:02 +0200 |
commit | a98d41f62bdb8b7aa903e8e37c1faa48fe8fdae8 (patch) | |
tree | 4c2a7bd537450ab1e394a4f5653634c030d3dc48 /include/godot_cpp/classes/wrapped.hpp | |
parent | 96675a814b9038b7da57607c34b8e7e69b8c1678 (diff) | |
parent | cb543c192aef18b3e9b9d2c9f2ba770a4e574ad0 (diff) | |
download | redot-cpp-a98d41f62bdb8b7aa903e8e37c1faa48fe8fdae8.tar.gz |
Merge pull request #1590 from dsnopek/reload-instance-bindings
Correctly set instance bindings on reload
Diffstat (limited to 'include/godot_cpp/classes/wrapped.hpp')
-rw-r--r-- | include/godot_cpp/classes/wrapped.hpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp index 0ffd783..a0bcec7 100644 --- a/include/godot_cpp/classes/wrapped.hpp +++ b/include/godot_cpp/classes/wrapped.hpp @@ -61,6 +61,10 @@ class Wrapped { thread_local static const StringName *_constructing_extension_class_name; thread_local static const GDExtensionInstanceBindingCallbacks *_constructing_class_binding_callbacks; +#ifdef HOT_RELOAD_ENABLED + thread_local static GDExtensionObjectPtr _constructing_recreate_owner; +#endif + template <typename T> _ALWAYS_INLINE_ static void _set_construct_info() { _constructing_extension_class_name = T::_get_extension_class_name(); @@ -71,15 +75,6 @@ protected: virtual bool _is_extension_class() const { return false; } static const StringName *_get_extension_class_name(); // This is needed to retrieve the class name before the godot object has its _extension and _extension_instance members assigned. -#ifdef HOT_RELOAD_ENABLED - struct RecreateInstance { - GDExtensionClassInstancePtr wrapper; - GDExtensionObjectPtr owner; - RecreateInstance *next; - }; - inline static RecreateInstance *recreate_instance = nullptr; -#endif - void _notification(int p_what) {} bool _set(const StringName &p_name, const Variant &p_property) { return false; } bool _get(const StringName &p_name, Variant &r_property) const { return false; } |