1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-05 17:15:09 +00:00

Fix GDNative compat breakage due to dangling Variants fix

This moves the instance id member from Variant to the ObjectRC so that Variant is still the same size as before the fix (and also regardless if debug or release build).
This commit is contained in:
Pedro J. Estébanez
2020-04-27 13:07:52 +02:00
parent 0233b7e51f
commit ac8b4708a3
5 changed files with 20 additions and 23 deletions

View File

@@ -1098,7 +1098,7 @@ void Variant::call_ptr(const StringName &p_method, const Variant **p_args, int p
Object *obj = _OBJ_PTR(*this);
if (!obj) {
#ifdef DEBUG_ENABLED
if (ScriptDebugger::get_singleton() && _get_obj().instance_id != 0 && !ObjectDB::get_instance(_get_obj().instance_id)) {
if (ScriptDebugger::get_singleton() && _get_obj().rc && !ObjectDB::get_instance(_get_obj().rc->instance_id)) {
WARN_PRINT("Attempted call on stray pointer object.");
}
#endif
@@ -1275,7 +1275,7 @@ bool Variant::has_method(const StringName &p_method) const {
Object *obj = _OBJ_PTR(*this);
if (!obj) {
#ifdef DEBUG_ENABLED
if (ScriptDebugger::get_singleton() && _get_obj().instance_id != 0 && !ObjectDB::get_instance(_get_obj().instance_id)) {
if (ScriptDebugger::get_singleton() && _get_obj().rc && !ObjectDB::get_instance(_get_obj().rc->instance_id)) {
WARN_PRINT("Attempted method check on stray pointer object.");
}
#endif