Removing the shutdownHook from the Actor object since we are no longer using Configgy and hence no risk of leaks thereof
This commit is contained in:
parent
5c4488730f
commit
e3bfd2f31a
2 changed files with 1 additions and 19 deletions
|
|
@ -162,7 +162,7 @@ object Timeout {
|
|||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
object Actor extends ListenerManagement {
|
||||
object Actor {
|
||||
|
||||
/**
|
||||
* A Receive is a convenience type that defines actor message behavior currently modeled as
|
||||
|
|
@ -170,23 +170,6 @@ object Actor extends ListenerManagement {
|
|||
*/
|
||||
type Receive = PartialFunction[Any, Unit]
|
||||
|
||||
/**
|
||||
* Add shutdown cleanups
|
||||
*/
|
||||
private[akka] lazy val shutdownHook = {
|
||||
val hook = new Runnable {
|
||||
override def run() {
|
||||
// Clear Thread.subclassAudits
|
||||
val tf = classOf[java.lang.Thread].getDeclaredField("subclassAudits")
|
||||
tf.setAccessible(true)
|
||||
val subclassAudits = tf.get(null).asInstanceOf[java.util.Map[_, _]]
|
||||
subclassAudits synchronized { subclassAudits.clear() }
|
||||
}
|
||||
}
|
||||
Runtime.getRuntime.addShutdownHook(new Thread(hook, "akka-shutdown-hook"))
|
||||
hook
|
||||
}
|
||||
|
||||
private[actor] val actorRefInCreation = new ThreadLocal[Stack[ActorRef]] {
|
||||
override def initialValue = Stack[ActorRef]()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ class AkkaLoader {
|
|||
println("Shutting down Akka...")
|
||||
_bundles.foreach(_.onUnload)
|
||||
_bundles = None
|
||||
Actor.shutdownHook.run
|
||||
println("Akka succesfully shut down")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue