Skip to content

Commit

Permalink
fix: #791 stack overflow in the weaver (#792)
Browse files Browse the repository at this point in the history
remove unnecessary manual dispose calls in weaver
  • Loading branch information
paulpach authored and miwarnec committed Apr 10, 2019
1 parent 5c850aa commit 7b57830
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions Assets/Mirror/Editor/Weaver/Weaver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -580,17 +580,13 @@ static bool Weave(string assName, IEnumerable<string> dependencies, IAssemblyRes
}
catch (Exception ex)
{
if (CurrentAssembly.MainModule.SymbolReader != null)
CurrentAssembly.MainModule.SymbolReader.Dispose();
Weaver.Error(ex.Message);
throw ex;
}
}

if (WeavingFailed)
{
if (CurrentAssembly.MainModule.SymbolReader != null)
CurrentAssembly.MainModule.SymbolReader.Dispose();
return false;
}
}
Expand All @@ -608,16 +604,12 @@ static bool Weave(string assName, IEnumerable<string> dependencies, IAssemblyRes
catch (Exception e)
{
Log.Error("ProcessPropertySites exception: " + e);
if (CurrentAssembly.MainModule.SymbolReader != null)
CurrentAssembly.MainModule.SymbolReader.Dispose();
return false;
}

if (WeavingFailed)
{
//Log.Error("Failed phase II.");
if (CurrentAssembly.MainModule.SymbolReader != null)
CurrentAssembly.MainModule.SymbolReader.Dispose();
return false;
}

Expand All @@ -627,9 +619,6 @@ static bool Weave(string assName, IEnumerable<string> dependencies, IAssemblyRes
WriterParameters writeParams = Helpers.GetWriterParameters(readParams);
CurrentAssembly.Write(dest, writeParams);
}

if (CurrentAssembly.MainModule.SymbolReader != null)
CurrentAssembly.MainModule.SymbolReader.Dispose();
}

return true;
Expand Down

0 comments on commit 7b57830

Please sign in to comment.