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

Mono

-

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

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.