Reorganize .gitignore
Improve handling of resource closing in notifyClosed