markusthoemmes commented on issue #3278: Fix NullPointerException in 
   This proves that `postStop` will also be called from an internal 
`context.stop` (and that the context is always there then, the NPE was actually 
in `shutdown`).
   object Testing {
     import scala.concurrent.Await
     class TestActor extends Actor {
       override def receive: Receive = {
         case "stop" => context.stop(self)
       override def postStop(): Unit = {
         println("Yep, I was called :)")
     def main(args: Array[String]): Unit = {
       implicit val as = ActorSystem()
       val testActor1 = as.actorOf(Props[TestActor])
       val testActor2 = as.actorOf(Props[TestActor])
       testActor2 ! "stop"
       Await.ready(as.terminate(), 10.seconds)

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

Reply via email to