Skip to content

Commit 280208e

Browse files
GC: clean up the maintained list of extra updates on onClear event (#1)
1 parent 79ba3f4 commit 280208e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/SimpleThings/EntityAudit/EventListener/LogRevisionsListener.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function __construct(AuditManager $auditManager)
9696

9797
public function getSubscribedEvents()
9898
{
99-
return array(Events::onFlush, Events::postPersist, Events::postUpdate, Events::postFlush);
99+
return array(Events::onFlush, Events::postPersist, Events::postUpdate, Events::postFlush, Events::onClear);
100100
}
101101

102102
/**
@@ -241,6 +241,11 @@ public function postUpdate(LifecycleEventArgs $eventArgs)
241241
$this->saveRevisionEntityData($class, $entityData, 'UPD');
242242
}
243243

244+
public function onClear()
245+
{
246+
$this->extraUpdates = array();
247+
}
248+
244249
public function onFlush(OnFlushEventArgs $eventArgs)
245250
{
246251
$this->em = $eventArgs->getEntityManager();

0 commit comments

Comments
 (0)