Skip to content

Commit

Permalink
Fix memory leak in TranslatorRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
bancer committed Feb 9, 2022
1 parent 547c15c commit 5830f07
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/I18n/TranslatorRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public function get($name, $locale = null)

$key = "translations.$name.$locale";
$translator = $this->_cacher->read($key);
gc_collect_cycles();
if (!$translator || !$translator->getPackage()) {
$translator = $this->_getTranslator($name, $locale);
$this->_cacher->write($key, $translator);
Expand Down

0 comments on commit 5830f07

Please sign in to comment.