Merge pull request #36532 from Faless/debugger/weakref_crash_vulkan

Fix debugger crash inspecting freed object.
This commit is contained in:
Rémi Verschelde 2020-02-25 16:45:12 +01:00 committed by GitHub
commit dace1ec912
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -347,13 +347,17 @@ void SceneDebuggerObject::serialize(Array &r_arr, int p_max_size) {
const PropertyInfo &pi = properties[i].first;
Variant &var = properties[i].second;
WeakRef *ref = Object::cast_to<WeakRef>(var);
if (ref) {
var = ref->get_ref();
}
RES res = var;
if (var.get_type() == Variant::OBJECT && var.is_ref()) {
REF r = var;
if (r.is_valid()) {
res = *r;
} else {
res = RES();
}
}
Array prop;
prop.push_back(pi.name);
prop.push_back(pi.type);