|Welcome to the Monastery|
XS DESTROY not invokedby CarlosV (Novice)
|on Sep 24, 2012 at 09:01 UTC||Need Help??|
CarlosV has asked for the
wisdom of the Perl Monks concerning the following question:
Debugging some memory leaks in a code with XS I have been reading perldoc perlxs guide to use DESTROY for freeing objects that get out of scope in perl. However my DESTROY function is never invoked and I can not understand why.
In the XS code there is a function "_new_from_der" that allocates memory and return it as a object "OpenCA_OpenSSL_CRL":
This object is typemapped in what I understand is substitution of "_" for "::"
So, following the perlxs doc I inserted this DESTROY:
But the DESTROY function is never invoked.
The main perl invocation is like this:
I also tried using PACKAGE = OpenCA_OpenSSL_CRLPtr with no luck.
What I am doing wrong?Regards,