Skip Menu |

This queue is for tickets about the Object-FromData CPAN distribution.

Report information
The Basics
Id: 117379
Status: new
Priority: 0/
Queue: Object-FromData

People
Owner: Nobody in particular
Requestors: haarg [...] haarg.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Object::FromData::Hash leaks and breaks on key reuse
Object::FromData::Hash will never clean up the subs it creates or the hash data stored in it. The subs it creates close over the hash directly, so they will keep the hash data alive indefinitely. It also reuses class names if the keys match, so creating a second object with the same keys will issue warnings, and break any existing object. If you are going to reuse class names, then the subs created need to access data though the object rather than close over the hash. This would still result in leaving the subs around for old objects. You would also want to either skip regenerating subs, or silence the warnings for overwriting them. The code could also be changed to always use unique class names, and then a DESTROY could clean up the subs.