From 7b57830e6c8e3b9abf470cf1029eb2e4aba914ee Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Wed, 10 Apr 2019 09:58:49 -0500 Subject: [PATCH] fix: #791 stack overflow in the weaver (#792) remove unnecessary manual dispose calls in weaver --- Assets/Mirror/Editor/Weaver/Weaver.cs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Assets/Mirror/Editor/Weaver/Weaver.cs b/Assets/Mirror/Editor/Weaver/Weaver.cs index 47e315421..50ff8100f 100644 --- a/Assets/Mirror/Editor/Weaver/Weaver.cs +++ b/Assets/Mirror/Editor/Weaver/Weaver.cs @@ -580,8 +580,6 @@ static bool Weave(string assName, IEnumerable dependencies, IAssemblyRes } catch (Exception ex) { - if (CurrentAssembly.MainModule.SymbolReader != null) - CurrentAssembly.MainModule.SymbolReader.Dispose(); Weaver.Error(ex.Message); throw ex; } @@ -589,8 +587,6 @@ static bool Weave(string assName, IEnumerable dependencies, IAssemblyRes if (WeavingFailed) { - if (CurrentAssembly.MainModule.SymbolReader != null) - CurrentAssembly.MainModule.SymbolReader.Dispose(); return false; } } @@ -608,16 +604,12 @@ static bool Weave(string assName, IEnumerable 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; } @@ -627,9 +619,6 @@ static bool Weave(string assName, IEnumerable dependencies, IAssemblyRes WriterParameters writeParams = Helpers.GetWriterParameters(readParams); CurrentAssembly.Write(dest, writeParams); } - - if (CurrentAssembly.MainModule.SymbolReader != null) - CurrentAssembly.MainModule.SymbolReader.Dispose(); } return true;