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

[TODO] FileSystemWatcher for openDialog is not properly disposed when application shutdown #3

Open
chaojian-zhang opened this issue Mar 4, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@chaojian-zhang
Copy link
Contributor

chaojian-zhang commented Mar 4, 2022

Description

TODO: Currently FileSystemWatcher for openDialog is not properly disposed when application shutdown
It won't work even if we call openDialog.Dispose(); GC.Collect() also doesn't help.
See gui-cs/Terminal.Gui#1524

To test this: select some .sm2 file and choose open, then wait for a few seconds to see the exception caused due to the FileSystemWatcher still tries to call a callback that access the now null Application.Mainloop.

Screenshots

Exception
Example

Remark

You can't force dispose all instances of a class with reflection;
Also see https://stackoverflow.com/questions/12368/how-to-dispose-a-class-in-net

Per: 2e40a21

@chaojian-zhang chaojian-zhang added the bug Something isn't working label Mar 4, 2022
@chaojian-zhang chaojian-zhang changed the title FileSystemWatcher for openDialog is not properly disposed when application shutdown [TODO] FileSystemWatcher for openDialog is not properly disposed when application shutdown Mar 4, 2022
@tznind
Copy link

tznind commented Mar 25, 2022

I think this will be fixed by gui-cs/Terminal.Gui#1651

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants