1 parent e251daa commit 90278fcCopy full SHA for 90278fc
1 file changed
Torch.Server/Views/LogEventViewer.xaml.cs
@@ -60,7 +60,8 @@ public LogEventViewer()
60
DataContext = new LogViewModel();
61
62
NlogCustomTarget.LogEventReceived += LogEvent;
63
-
+ TorchServer.Instance.SessionUnloading += Unloading;
64
+
65
66
//on loaded event
67
Loaded += (sender, args) =>
@@ -71,6 +72,11 @@ public LogEventViewer()
71
72
};
73
}
74
75
+ private void Unloading()
76
+ {
77
+ NlogCustomTarget.LogEventReceived -= LogEvent;
78
+ }
79
80
private void LogEvent(LogEventInfo obj)
81
{
82
// Use Dispatcher.Invoke to ensure that the following code block is executed on the UI thread.
@@ -95,8 +101,6 @@ private void LogEvent(LogEventInfo obj)
95
101
96
102
});
97
103
98
99
100
104
private void LevelFilterComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
105
106
ApplyFilters();
0 commit comments