From cb543c192aef18b3e9b9d2c9f2ba770a4e574ad0 Mon Sep 17 00:00:00 2001 From: David Snopek Date: Tue, 17 Sep 2024 09:18:08 -0500 Subject: Correctly set instance bindings on reload --- include/godot_cpp/core/class_db.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/godot_cpp/core') diff --git a/include/godot_cpp/core/class_db.hpp b/include/godot_cpp/core/class_db.hpp index 988277b..85bc0fb 100644 --- a/include/godot_cpp/core/class_db.hpp +++ b/include/godot_cpp/core/class_db.hpp @@ -129,9 +129,8 @@ private: static GDExtensionClassInstancePtr _recreate_instance_func(void *data, GDExtensionObjectPtr obj) { if constexpr (!std::is_abstract_v) { #ifdef HOT_RELOAD_ENABLED + Wrapped::_constructing_recreate_owner = obj; T *new_instance = (T *)memalloc(sizeof(T)); - Wrapped::RecreateInstance recreate_data = { new_instance, obj, Wrapped::recreate_instance }; - Wrapped::recreate_instance = &recreate_data; memnew_placement(new_instance, T); return new_instance; #else -- cgit v1.2.3