Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this was two different leaks rolled into one, which i will explain below. i also have to note the test still leaks some objects, but i don't have the time to do full analysis on that
modules used to diagnose the leaks:
Net::Prometheus, Devel::Gladiator, Devel::FindRef, Devel::Cycle
#1 is the globals in the parser holding on to things
normally deciding when to clean these up could be a little tricky, but the parsing appears to be contained entirely within the _new method, so we can declare them local and have perl reset them at the end of scope
optimally Convert::ASN1 would take care of this so they're deleted after they're needed; as well as instanced per object or creation of new parsers guarded while one is currently active
#2 is PKCS10 creating the object, running ->find on it, which returns a shallow copy with a reference to a config hash in the original object, then puts said shallow copy into the config hash of the original object, which creates a cycle
i don't know whether a deep clone is appropriate there, so i just had the wrapping module weaken the reference to the config hash