summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp/core
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-09-17 09:18:08 -0500
committerDavid Snopek <dsnopek@gmail.com>2024-09-17 09:18:08 -0500
commitcb543c192aef18b3e9b9d2c9f2ba770a4e574ad0 (patch)
tree025832ed1d31a70355156b9e3d27107dcbac28ad /include/godot_cpp/core
parent4131b7f95f5a4ec660484431b175e15d95aed8db (diff)
downloadredot-cpp-cb543c192aef18b3e9b9d2c9f2ba770a4e574ad0.tar.gz
Correctly set instance bindings on reload
Diffstat (limited to 'include/godot_cpp/core')
-rw-r--r--include/godot_cpp/core/class_db.hpp3
1 files changed, 1 insertions, 2 deletions
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<T>) {
#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