Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EventDispatcher] fix memory leak in getListeners #15821

Merged
merged 2 commits into from Sep 22, 2015

Conversation

Tobion
Copy link
Member

@Tobion Tobion commented Sep 17, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

@@ -46,21 +44,23 @@ public function dispatch($eventName, Event $event = null)
$event->setDispatcher($this);
$event->setName($eventName);

if (!isset($this->listeners[$eventName])) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't bring much value and is not reliable anyway as it could also be set with an empty array by adding and removing a listener. By removing this we can also save a call to lazyLoad in the overwritten ContainerAwareEventDispatcher

@Tobion Tobion changed the title [EventDispatcher] fix memory in getListeners [EventDispatcher] fix memory leak in getListeners Sep 17, 2015
@sstok
Copy link
Contributor

sstok commented Sep 17, 2015

LGTM 👍

@fabpot
Copy link
Member

fabpot commented Sep 22, 2015

Thank you @Tobion.

@fabpot fabpot merged commit a7b7f54 into symfony:2.3 Sep 22, 2015
fabpot added a commit that referenced this pull request Sep 22, 2015
This PR was merged into the 2.3 branch.

Discussion
----------

[EventDispatcher] fix memory leak in getListeners

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

a7b7f54 [EventDispatcher] skip one lazy loading call
ec59953 [EventDispatcher] fix memory leak in a getListeners
@Tobion Tobion deleted the fix-memory-leak-event-dispatcher branch September 22, 2015 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants