diff --git a/examples/net_framework/DeepSpeechWPF/MainWindow.xaml.cs b/examples/net_framework/DeepSpeechWPF/MainWindow.xaml.cs index e6bfe22e..8b38316c 100644 --- a/examples/net_framework/DeepSpeechWPF/MainWindow.xaml.cs +++ b/examples/net_framework/DeepSpeechWPF/MainWindow.xaml.cs @@ -83,7 +83,7 @@ namespace DeepSpeechWPF catch (Exception ex) { MessageBox.Show(ex.Message); - Close(); + Dispatcher.Invoke(() => { Close(); }); } }); }