Merge pull request #1488 from akka/wip-3393-Trigger-NPE-∂π
do not close over context.self in TickGenerator, see #3393
This commit is contained in:
commit
a5364fc496
1 changed files with 5 additions and 2 deletions
|
|
@ -1197,10 +1197,13 @@ class TickGenerator[Cmd <: AnyRef, Evt <: AnyRef](interval: FiniteDuration)
|
|||
new PipePair[Cmd, Cmd, Evt, Evt] {
|
||||
|
||||
// use unique object to avoid double-activation on actor restart
|
||||
private val trigger: Trigger =
|
||||
private val trigger: Trigger = {
|
||||
val path = ctx.getContext.self.path
|
||||
|
||||
new Trigger {
|
||||
override def toString = s"Tick[${ctx.getContext.self.path}]"
|
||||
override def toString = s"Tick[$path]"
|
||||
}
|
||||
}
|
||||
|
||||
private def schedule() =
|
||||
ctx.getContext.system.scheduler.scheduleOnce(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue