소스 검색

Autosave all on crash

Krzysztof Krysiński 1 년 전
부모
커밋
2141eba878
1개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  1. 12 1
      src/PixiEditor/Views/MainWindow.xaml.cs

+ 12 - 1
src/PixiEditor/Views/MainWindow.xaml.cs

@@ -277,7 +277,18 @@ internal partial class MainWindow : Window
 
     private void MainWindow_Initialized(object sender, EventArgs e)
     {
-        AppDomain.CurrentDomain.UnhandledException += (sender, e) => Helpers.CrashHelper.SaveCrashInfo((Exception)e.ExceptionObject);
+        AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
+        {
+            try
+            {
+                DataContext.AutosaveAllForNextSession();
+            }
+            finally
+            {
+                CrashHelper.SaveCrashInfo((Exception)e.ExceptionObject);
+
+            }
+        };
     }
 
     private void MainWindow_Drop(object sender, DragEventArgs e)