Subject: | memory leak in FSA::States |
Greetings,
I detected a memory leak problem with FSA::Rules.
Due the usage of lexical %machines and %states hash tables that keep references of all objects, the FSA::Rule object and FSA::States associated with it are not release from memory because their references count will keep higher than zero until the termination of the program.
I attached a patch that will make both hash tables accessible as package variables, which will make possible to remove the references as necessary, making it possible that the respective DESTROY method from the objects will be invoked as soon as the references are removed.
To do that, I added to the patch the free_refs methods, which should destroy all references for the specific FSA::Rule object. This method must be invoked when the FSA::Rule object is not necessary anymore, probably at the end of lexical context where it was declared. It would be also interesting to do the same in the destruct method from objects, although I cannot say that the DESTROY method from FSA::Rule and FSA::State will be invoked before the end of the destructor method.
Subject: | patch-0.31 |
Message body not shown because it is not plain text.