浏览代码

Merge pull request #39736 from naithar/fix/deleted-object-stringify

Fix for a crash on printing freed object
Rémi Verschelde 5 年之前
父节点
当前提交
75791358c6
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      core/variant.cpp

+ 4 - 0
core/variant.cpp

@@ -1598,6 +1598,10 @@ String Variant::stringify(List<const void *> &stack) const {
 
 			Object *obj = _OBJ_PTR(*this);
 			if (obj) {
+				if (_get_obj().ref.is_null() && !ObjectDB::get_instance(obj->get_instance_id())) {
+					return "[Deleted Object]";
+				}
+
 				return obj->to_string();
 			} else {
 #ifdef DEBUG_ENABLED