Skip to content

Commit

Permalink
bug #36460 [Cache] Avoid memory leak in TraceableAdapter::reset() (ly…
Browse files Browse the repository at this point in the history
…rixx)

This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] Avoid memory leak in TraceableAdapter::reset()

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

When we call `ServicesResetter::reset()`, we want to reset the
application to its initial states. We don't want a memory leak :p

Commits
-------

15a8610 [Cache] Avoid memory leak in TraceableAdapter::reset()
  • Loading branch information
fabpot committed Apr 17, 2020
2 parents f702863 + 15a8610 commit 17bbaa5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Symfony/Component/Cache/Adapter/TraceableAdapter.php
Expand Up @@ -191,15 +191,11 @@ public function prune()
*/
public function reset()
{
if (!$this->pool instanceof ResettableInterface) {
return;
}
$event = $this->start(__FUNCTION__);
try {
if ($this->pool instanceof ResettableInterface) {
$this->pool->reset();
} finally {
$event->end = microtime(true);
}

$this->clearCalls();
}

public function getCalls()
Expand Down

0 comments on commit 17bbaa5

Please sign in to comment.