mirror of https://github.com/sbt/sbt.git
Close URLClassLoaders after getting bridge
The ZincComponentCompilerSpec was fail with a metaspace related error when run locally with a recent version of sbt on my machine. I was able to stop these failures by closing the URLClassLoader instances used to compile the bridge.
This commit is contained in:
parent
31a3ad61c9
commit
f4a2bcd0ce
|
|
@ -8,6 +8,7 @@
|
|||
package sbt.internal.inc
|
||||
|
||||
import java.io.File
|
||||
import java.net.URLClassLoader
|
||||
|
||||
import sbt.io.IO
|
||||
import sbt.io.syntax._
|
||||
|
|
@ -59,6 +60,8 @@ abstract class IvyBridgeProviderSpecification extends FlatSpec with Matchers {
|
|||
val provider = getZincProvider(bridge1, targetDir, log)
|
||||
val scalaInstance = provider.fetchScalaInstance(scalaVersion, log)
|
||||
val bridge = provider.fetchCompiledBridge(scalaInstance, log)
|
||||
scalaInstance.loader.asInstanceOf[URLClassLoader].close()
|
||||
scalaInstance.loaderLibraryOnly.asInstanceOf[URLClassLoader].close()
|
||||
val target = targetDir / s"target-bridge-$scalaVersion.jar"
|
||||
IO.copyFile(bridge, target)
|
||||
target
|
||||
|
|
|
|||
Loading…
Reference in New Issue