diff options
Diffstat (limited to 'modules')
3 files changed, 13 insertions, 6 deletions
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 7a6a7bcf48..c3d651ee79 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -1718,6 +1718,7 @@ Error GDScriptCompiler::_parse_function(GDScript *p_script, const GDScriptParser GDScriptCodeGenerator::Address src_address = _parse_expression(codegen, error, field->initializer, false, true); if (error) { + memdelete(codegen.generator); return error; } GDScriptCodeGenerator::Address dst_address(GDScriptCodeGenerator::Address::MEMBER, codegen.script->member_indices[field->identifier->name].index, _gdtype_from_datatype(field->get_datatype())); @@ -1738,6 +1739,7 @@ Error GDScriptCompiler::_parse_function(GDScript *p_script, const GDScriptParser const GDScriptParser::ParameterNode *parameter = p_func->parameters[i]; GDScriptCodeGenerator::Address src_addr = _parse_expression(codegen, error, parameter->default_value, true); if (error) { + memdelete(codegen.generator); return error; } GDScriptCodeGenerator::Address dst_addr = codegen.parameters[parameter->identifier->name]; @@ -1751,6 +1753,7 @@ Error GDScriptCompiler::_parse_function(GDScript *p_script, const GDScriptParser Error err = _parse_block(codegen, p_func->body); if (err) { + memdelete(codegen.generator); return err; } } @@ -1800,6 +1803,8 @@ Error GDScriptCompiler::_parse_function(GDScript *p_script, const GDScriptParser p_script->member_functions[func_name] = gd_function; + memdelete(codegen.generator); + return OK; } @@ -1837,6 +1842,7 @@ Error GDScriptCompiler::_parse_setter_getter(GDScript *p_script, const GDScriptP error = _parse_block(codegen, p_is_setter ? p_variable->setter : p_variable->getter); if (error) { + memdelete(codegen.generator); return error; } @@ -1870,6 +1876,7 @@ Error GDScriptCompiler::_parse_setter_getter(GDScript *p_script, const GDScriptP #ifdef TOOLS_ENABLED p_script->member_lines[func_name] = p_is_setter ? p_variable->setter->start_line : p_variable->getter->start_line; #endif + memdelete(codegen.generator); return OK; } diff --git a/modules/mono/build_scripts/mono_reg_utils.py b/modules/mono/build_scripts/mono_reg_utils.py index 3090a4759a..0ec7e2f433 100644 --- a/modules/mono/build_scripts/mono_reg_utils.py +++ b/modules/mono/build_scripts/mono_reg_utils.py @@ -9,7 +9,7 @@ if os.name == "nt": def _reg_open_key(key, subkey): try: return winreg.OpenKey(key, subkey) - except (WindowsError, OSError): + except OSError: if platform.architecture()[0] == "32bit": bitness_sam = winreg.KEY_WOW64_64KEY else: @@ -37,7 +37,7 @@ def _find_mono_in_reg(subkey, bits): with _reg_open_key_bits(winreg.HKEY_LOCAL_MACHINE, subkey, bits) as hKey: value = winreg.QueryValueEx(hKey, "SdkInstallRoot")[0] return value - except (WindowsError, OSError): + except OSError: return None @@ -48,7 +48,7 @@ def _find_mono_in_reg_old(subkey, bits): if default_clr: return _find_mono_in_reg(subkey + "\\" + default_clr, bits) return None - except (WindowsError, EnvironmentError): + except OSError: return None @@ -97,7 +97,7 @@ def find_msbuild_tools_path_reg(): raise ValueError("Cannot find `installationPath` entry") except ValueError as e: print("Error reading output from vswhere: " + e.message) - except WindowsError: + except OSError: pass # Fine, vswhere not found except (subprocess.CalledProcessError, OSError): pass @@ -109,5 +109,5 @@ def find_msbuild_tools_path_reg(): with _reg_open_key(winreg.HKEY_LOCAL_MACHINE, subkey) as hKey: value = winreg.QueryValueEx(hKey, "MSBuildToolsPath")[0] return value - except (WindowsError, OSError): + except OSError: return "" diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj index 41c94f19c8..e4d6b2e010 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj @@ -20,7 +20,7 @@ <ItemGroup> <None Include="MSBuild.exe" CopyToOutputDirectory="Always" /> </ItemGroup> - <Target Name="CopyMSBuildStubWindows" AfterTargets="Build" Condition="$([MSBuild]::IsOsPlatform(Windows))"> + <Target Name="CopyMSBuildStubWindows" AfterTargets="Build" Condition=" '$(GodotPlatform)' == 'windows' Or ( '$(GodotPlatform)' == '' And '$(OS)' == 'Windows_NT' ) "> <PropertyGroup> <GodotSourceRootPath>$(SolutionDir)/../../../../</GodotSourceRootPath> <GodotOutputDataDir>$(GodotSourceRootPath)/bin/GodotSharp</GodotOutputDataDir> |