Search Issue Tracker
Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.
Postponed
Votes
2
Found in
5.3.3p1
Issue ID
779505
Regression
No
'finally' block of try/finally in coroutine is not called when object is destroyed
Steps to reproduce:
1. Download and open attached project "CoroutineNoDisposeRepro.zip"
2. Open scene "Scene1" and play it
3. Press either "Open Scene 2" or "Destroy Object"
4. Notice that "Resource In Use" is still true, as indicated by string on the screen
5. Press "Stop And Dispose" and notice that resource is no longer in use, also indicated by string on screen "Resource Available"
Actual result: If game object which has co-routine is destroyed, "finally" part of "try {} finally {}" block is not called
Expected result: "finally" part of "try {} finally {}" block is called automatically when the object is destroyed, not only when it is manually disposed
Tested and reproduced on:
Windows 10
Unity 5.1.4f1, 5.2.4p1, 5.3.4p1, 5.4.0b13
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- 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
Add comment