fixes for support Unity 2020.1.x

This commit is contained in:
Mikhail 2024-01-04 22:52:12 +08:00
parent 908b6328cd
commit db29061ccb

View File

@ -18,6 +18,8 @@ namespace DCFApixels.DragonECS
private static bool _isRunning = false; private static bool _isRunning = false;
private static object _lock = new object();
private static void ThreadProc(object obj) private static void ThreadProc(object obj)
{ {
int i = (int)obj; int i = (int)obj;
@ -117,9 +119,12 @@ namespace DCFApixels.DragonECS
_worker = _nullWorker; _worker = _nullWorker;
if (_catchedExceptions.Count > 0) if (_catchedExceptions.Count > 0)
{ {
Exception[] exceptions = _catchedExceptions.ToArray(); lock (_lock)
_catchedExceptions.Clear(); {
throw new AggregateException(exceptions); Exception[] exceptions = _catchedExceptions.ToArray();
_catchedExceptions = new ConcurrentQueue<Exception>();
throw new AggregateException(exceptions);
}
} }
} }