Merge pull request #56651 from gerhean/Fix-leak-when-function-returning-parent-class-type

This commit is contained in:
Rémi Verschelde 2022-01-10 16:59:36 +01:00 committed by GitHub
commit eea510fc35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2069,7 +2069,7 @@ GDScriptFunction *GDScriptCompiler::_parse_function(Error &r_error, GDScript *p_
if (p_func) {
// if no return statement -> return type is void not unresolved Variant
if (p_func->body->has_return) {
gd_function->return_type = _gdtype_from_datatype(p_func->get_datatype());
gd_function->return_type = _gdtype_from_datatype(p_func->get_datatype(), p_script);
} else {
gd_function->return_type = GDScriptDataType();
gd_function->return_type.has_type = true;