@@ -606,6 +606,8 @@ List<RegexResult> GetMatchesFor(string text, string fileName = "", int selection
606
606
MatchResultsTreeView . ItemsSource = GetMatchesFor ( sourceScript . Get ( ) . ToString ( ) , "script" ) ;
607
607
608
608
MatchesResultLabel . Content = $ "{ i } matches [Index,Length] + { countAllCaptures - i } empties matches";
609
+
610
+ csEval . UnloadOwnerDomain ( ) ;
609
611
}
610
612
else
611
613
{
@@ -737,6 +739,8 @@ private void ReplaceAllButton_Click(object sender, RoutedEventArgs e)
737
739
index ++ ;
738
740
return script . Replace ( match , index , "script" , index , 0 ) ;
739
741
} ) , "script" , null ) ) ;
742
+
743
+ csEval . UnloadOwnerDomain ( ) ;
740
744
break ;
741
745
default :
742
746
currentFileName = GetCurrentFileName ? . Invoke ( ) ?? string . Empty ;
@@ -749,6 +753,8 @@ private void ReplaceAllButton_Click(object sender, RoutedEventArgs e)
749
753
} ) , currentFileName , null ) ) ;
750
754
break ;
751
755
}
756
+
757
+ csEval . UnloadOwnerDomain ( ) ;
752
758
}
753
759
else
754
760
{
@@ -809,6 +815,7 @@ private void ReplaceAllButton_Click(object sender, RoutedEventArgs e)
809
815
text = script . Get ( ) . ToString ( ) ;
810
816
nbrOfElementToReplace = regex . Matches ( text ) . Count ;
811
817
SetTextInNew ( regex . Replace ( text , ReplaceEditor . Text ) ) ;
818
+ csEval . UnloadOwnerDomain ( ) ;
812
819
break ;
813
820
default :
814
821
text = GetCurrentText ( ) ;
@@ -948,6 +955,10 @@ void Extract(string text, string fileName = "")
948
955
{
949
956
MessageBox . Show ( ex . Message + ex . StackTrace ) ;
950
957
}
958
+ finally
959
+ {
960
+ csEval . UnloadOwnerDomain ( ) ;
961
+ }
951
962
}
952
963
953
964
private List < string > GetFiles ( )
@@ -1607,6 +1618,10 @@ private void ReplaceInEditor_MenuItem_Click(object sender, RoutedEventArgs e)
1607
1618
{
1608
1619
MessageBox . Show ( exception . Message ) ;
1609
1620
}
1621
+ finally
1622
+ {
1623
+ csEval . UnloadOwnerDomain ( ) ;
1624
+ }
1610
1625
}
1611
1626
1612
1627
private void InsertValueInReplaceField_MenuItem_Click ( object sender , RoutedEventArgs e )
@@ -2120,6 +2135,10 @@ private void TestCSharpTextSourceButton_Click(object sender, RoutedEventArgs e)
2120
2135
{
2121
2136
MessageBox . Show ( $ "{ exception } ") ;
2122
2137
}
2138
+ finally
2139
+ {
2140
+ csEval . UnloadOwnerDomain ( ) ;
2141
+ }
2123
2142
}
2124
2143
2125
2144
private void ExportToVisualStudio_Click ( object sender , RoutedEventArgs e )
0 commit comments