IEnumerator Executer()
{
while (true)
{
yield return null;
while (calls.Count > 0)
{
calls[0].Execute(); // ← thread unsafe! GC may occur if it is added by another thread.
lock (callsLock)
{
calls.RemoveAt(0);
}
}
while (functions.Count > 0)
{
if(functions[0] != null){
functions[0](); // ← thread unsafe! GC may occur if it is added by another thread.
}
lock (functionsLock)
{
functions.RemoveAt(0);
}
}
}
}
Someone reported issues with mainthread.cs and suggested small fix (below this code)
Assets\PointCloudTools\PointCloudViewerDX11\Scripts\Common\MainThread.cs:
modified: