Search Issue Tracker
Fixed in 2018.2.X
Votes
0
Found in
2017.2.1p2
Issue ID
991724
Regression
No
BackgroundWorker's completion callback doesn't get called at the end of the task
To reproduce:
1) Create new project
2) Create and open new C# script
3) Add this function to it (and necessary using's):
[UnityEditor.MenuItem("Window/Test BackgroundWorker")]
private static void TestBackgroundWorker()
{
var w = new BackgroundWorker();
w.RunWorkerCompleted += (o, e) => UnityEngine.Debug.Log("Completed");
w.DoWork += (o, e) => { UnityEngine.Debug.Log("Background task start"); Thread.Sleep(1000); UnityEngine.Debug.Log("Background task end"); };
w.RunWorkerAsync();
}
4) Save the script
5) In top menu bar, select the new menu option you created (Window/Test BackgroundWorker)
Expected: You should get three messages - task start, end and completion
Actual: Completion message doesn't fire
Does not happen in play mode - all three messages fire there
Reproduced in 2017.1.0f3, 2017.2.1p2, 2018.1.0b3
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
- [RenderingDebugger][InputSystemPackage] Ctrl+Backspace shortcut doesn't work to open the Rendering Debugger when New Input System is in use
- No option to skip video transcoding when launching a Project
- “ValidateSchema Error2” error is thrown in the Player when using IL2CPP Scripting Backend
msue2
Dec 19, 2019 10:21
In the Editor, the background worker's completion callback is not called still, in case the Editor enters play mode during background execution. The thread appears to be silently terminated (2019.2.1f1).