Skip to content

fix: Close URLClassLoader in SassCompile to prevent resource leak#1725

Open
Frisch12 wants to merge 2 commits intomainfrom
fix/sass-classloader-leak
Open

fix: Close URLClassLoader in SassCompile to prevent resource leak#1725
Frisch12 wants to merge 2 commits intomainfrom
fix/sass-classloader-leak

Conversation

@Frisch12
Copy link
Copy Markdown
Member

@Frisch12 Frisch12 commented Apr 3, 2026

Summary

  • Fixes a resource leak where the URLClassLoader created for webjars processing was never closed
  • The loader holds open JAR file handles for the lifetime of the JVM
  • Now properly closed after compilation completes inside the existing try-with-resources block

Found during automated main branch review.

Test plan

  • Verify Sass compilation still works with webjars configured
  • Verify Sass compilation without webjars is unaffected

Frisch12 added 2 commits April 3, 2026 18:20
The URLClassLoader created for webjars was never closed, leaking JAR
file handles for the lifetime of the JVM. Close it after compilation
completes inside the existing try-with-resources block.
…ions

The manual null-check close was not reached when exceptions were thrown
from the visit() callback. Wrapping in try-with-resources guarantees
the loader is closed on all code paths.

Also fix error message referencing realMap instead of realOut in the
output file write-failure branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant