summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--binding_generator.py9
-rw-r--r--src/classes/wrapped.cpp3
2 files changed, 10 insertions, 2 deletions
diff --git a/binding_generator.py b/binding_generator.py
index 754167f..e7609b2 100644
--- a/binding_generator.py
+++ b/binding_generator.py
@@ -2166,6 +2166,12 @@ def generate_utility_functions(api, output_dir):
header.append("public:")
for function in api["utility_functions"]:
+ if function["name"] == "is_instance_valid":
+ # The `is_instance_valid()` function doesn't work as developers expect, and unless used very
+ # carefully will cause crashes. Instead, developers should use `ObjectDB::get_instance()`
+ # with object ids to ensure that an instance is still valid.
+ continue
+
vararg = "is_vararg" in function and function["is_vararg"]
function_signature = "\t"
@@ -2200,6 +2206,9 @@ def generate_utility_functions(api, output_dir):
source.append("")
for function in api["utility_functions"]:
+ if function["name"] == "is_instance_valid":
+ continue
+
vararg = "is_vararg" in function and function["is_vararg"]
function_signature = make_signature("UtilityFunctions", function)
diff --git a/src/classes/wrapped.cpp b/src/classes/wrapped.cpp
index 52d4495..ffca4f9 100644
--- a/src/classes/wrapped.cpp
+++ b/src/classes/wrapped.cpp
@@ -84,8 +84,7 @@ Wrapped::Wrapped(const StringName p_godot_class) {
godot::internal::gdextension_interface_object_set_instance_binding(_owner, godot::internal::token, this, _constructing_class_binding_callbacks);
_constructing_class_binding_callbacks = nullptr;
} else {
- ERR_PRINT("BUG: create a Godot Object without binding callbacks.");
- CRASH_NOW_MSG("BUG: create a Godot Object without binding callbacks.");
+ CRASH_NOW_MSG("BUG: Godot Object created without binding callbacks. Did you forget to use memnew()?");
}
}