Skip to content

Commit

Permalink
Merge pull request #16574 from niden/T16571-helperfactory-mapper
Browse files Browse the repository at this point in the history
T16571 helperfactory mapper
  • Loading branch information
niden authored Apr 29, 2024
2 parents fdfc87f + 735ce5c commit ad6678e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Changed

- Changed `Phalcon\Support\HelperFactory` to use the internal mapper for better memory management [#16571](https://github.com/phalcon/cphalcon/issues/16571)

### Added

### Fixed
Expand Down
7 changes: 6 additions & 1 deletion phalcon/Support/HelperFactory.zep
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ class HelperFactory extends AbstractFactory
*/
public function newInstance(string name)
{
return create_instance(this->getService(name));
if (true !== isset(this->services[name])) {
let this->services[name] = create_instance(this->getService(name));
}

return this->services[name];

}

/**
Expand Down

0 comments on commit ad6678e

Please sign in to comment.