Skip to content

Commit

Permalink
Merge pull request akka#19696 from keredin/master
Browse files Browse the repository at this point in the history
Fix memory leak in AddressTerminatedTopic, refs akka#19672
  • Loading branch information
drewhk committed Feb 8, 2016
2 parents ac6b736 + 4374748 commit 954d8d9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions akka-actor/src/main/scala/akka/actor/dungeon/DeathWatch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

package akka.actor.dungeon

import akka.actor.{ Terminated, InternalActorRef, ActorRef, ActorRefScope, ActorCell, Actor, Address }
import akka.dispatch.sysmsg.{ DeathWatchNotification, Watch, Unwatch }
import akka.event.Logging.{ Warning, Error, Debug }
import scala.util.control.NonFatal
import akka.actor.MinimalActorRef
import akka.dispatch.sysmsg.{Unwatch, Watch, DeathWatchNotification}
import akka.event.Logging.{Warning, Debug}
import akka.actor.{InternalActorRef, Address, Terminated, Actor, ActorRefScope, ActorCell, ActorRef, MinimalActorRef}
import akka.event.AddressTerminatedTopic

private[akka] trait DeathWatch { this: ActorCell
Expand Down Expand Up @@ -101,7 +99,11 @@ private[akka] trait DeathWatch { this: ActorCell ⇒
*/
watchedBy foreach sendTerminated(ifLocal = false)
watchedBy foreach sendTerminated(ifLocal = true)
} finally watchedBy = ActorCell.emptyActorRefSet
} finally {
maintainAddressTerminatedSubscription() {
watchedBy = ActorCell.emptyActorRefSet
}
}
}

protected def unwatchWatchedActors(actor: Actor): Unit =
Expand Down

0 comments on commit 954d8d9

Please sign in to comment.