2
0
Krzysztof Krysiński 1 жил өмнө
parent
commit
2141eba878

+ 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)