DDC-3914: [GH-1515] [DDC-3146] Remove event listener from abstract hydrator in cleanup function #4787

Closed
opened 2026-01-22 14:49:24 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 24, 2015).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of emiel-silverstreet:

Url: https://github.com/doctrine/doctrine2/pull/1515

Message:

When the iterate function is invoked an event listener is added, but never removed. This will keep a reference to the abstract hydrator in the event manager, which will prevent the php garbage collector from removing the instance. When used multiple times this will create a memory leak because the event manager will be filled with references to unused hydrators. This fix will remove the event listener in the cleanup function which is invoked when the hydrator is finished, allowing the class to be garbage collected.

Originally created by @doctrinebot on GitHub (Sep 24, 2015). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user @doctrinebot: This issue is created automatically through a Github pull request on behalf of emiel-silverstreet: Url: https://github.com/doctrine/doctrine2/pull/1515 Message: When the iterate function is invoked an event listener is added, but never removed. This will keep a reference to the abstract hydrator in the event manager, which will prevent the php garbage collector from removing the instance. When used multiple times this will create a memory leak because the event manager will be filled with references to unused hydrators. This fix will remove the event listener in the cleanup function which is invoked when the hydrator is finished, allowing the class to be garbage collected.
admin added the Bug label 2026-01-22 14:49:24 +01:00
admin closed this issue 2026-01-22 14:49:25 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4787