Add popup for exception on worker thread.

This commit is contained in:
2022-11-15 17:20:00 +08:00
parent 3a54d2023f
commit 5444ea7186

View File

@@ -191,9 +191,10 @@ namespace Cryville.Crtr {
Logger.Log("main", 1, "Load/MainThread", "Main thread done ({0}ms)", texloadtimer.Elapsed.TotalMilliseconds);
}
if (!loadThread.IsAlive) {
if (cbus == null) {
if (threadException != null) {
Logger.Log("main", 4, "Load/MainThread", "Load failed");
loadThread = null;
Popup.CreateException(threadException);
#if BUILD
ReturnToMenu();
#endif
@@ -447,6 +448,7 @@ namespace Cryville.Crtr {
public FileInfo skinFile;
}
Exception threadException;
#if !NO_THREAD
Thread loadThread = null;
diag::Stopwatch workerTimer;
@@ -463,6 +465,7 @@ namespace Cryville.Crtr {
}
catch (Exception ex) {
Game.LogException("Load/WorkerThread", "An error occured while loading the data", ex);
threadException = ex;
}
}