Github user jochenberger commented on a diff in the pull request: https://github.com/apache/groovy/pull/445#discussion_r82783539 --- Diff: src/main/groovy/lang/GroovyClassLoader.java --- @@ -969,13 +970,24 @@ public Void run() { */ public void clearCache() { synchronized (classCache) { + for (Class cl : classCache.values()) { + InvokerHelper.removeClass(cl); + } classCache.clear(); } synchronized (sourceCache) { sourceCache.clear(); } } + @Override + public void close() throws IOException { + super.close(); + for (Class cl : classCache.values()) { --- End diff -- I thought that synchronization might not be an issue since we are `close`-ing the ClassLoader anyway and I wanted to avoid the additional cost of synchronizing over and clearing `sourceCache`. But I guess it's better safe than sorry, so I made the change.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---