Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File handles are not closed if an exception occurs (Mono) #29043

Closed
andy-noisyduck opened this issue May 20, 2019 · 2 comments
Closed

File handles are not closed if an exception occurs (Mono) #29043

andy-noisyduck opened this issue May 20, 2019 · 2 comments

Comments

@andy-noisyduck
Copy link
Contributor

Godot version:
3.1.1 (Mono)

OS/device including version:
Windows 10

Issue description:
Files opened with the File class are not closed if an exception occurs and the editor remains open. If you open a file in an exclusive mode (e.g. WriteRead), and an exception occurs later on in your Godot program, the program will exit, but the file will remain locked. It will continue to be locked until the editor is restarted. I think this is Mono only due to it requiring an exception to be thrown. Behaviour may be different on other OS's too.

The issue is exacerbated by #29039, as the failure message when open the file on the next run is generic.

Steps to reproduce:

  1. Open a file using the File in exclusive mode (i.e. File.ModeFlags.WriteRead)
  2. Throw an unhandled exception
  3. Try to open the file externally - it will be locked.

Minimal reproduction project:
Testing-FileExceptionLocking.zip

@andy-noisyduck andy-noisyduck changed the title Files handles are not closed if an exception occurs (Mono) File handles are not closed if an exception occurs (Mono) May 20, 2019
@akien-mga akien-mga added this to the 3.2 milestone May 20, 2019
@akien-mga akien-mga modified the milestones: 3.2, 4.0 Jan 15, 2020
@KoBeWi
Copy link
Member

KoBeWi commented Nov 28, 2020

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

@andy-noisyduck
Copy link
Contributor Author

@KoBeWi This no longer happens for me in 3.2.3. Closing.

@KoBeWi KoBeWi modified the milestones: 4.0, 3.2 Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants