Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: XS DESTROY not invoked

by CarlosV (Novice)
on Sep 24, 2012 at 09:32 UTC ( #995329=note: print w/ replies, xml ) Need Help??


in reply to XS DESTROY not invoked

Wow, replying to myself. After reading a doc called "XS Mechanics" I did a last try, and this worked:

###################################################################### +### MODULE = OpenCA::OpenSSL PACKAGE = OpenCA::OpenSSL::CRL void DESTROY(crl) OpenCA_OpenSSL_CRL crl CODE: fprintf(stderr, "DESTROY\n"); X509_CRL_free(crl);

I am not 100% sure why this works, but as I read in the XS Mechanics, it seems that Ptr is only used/converted when a * is in the object, and as this is not the case, we don't need the Ptr at all, so the DESTROY can be in the OpenCA::OpenSSL::CRL package directly

Sigh... I have been all weekend fighting with this, and never tried this :(


Comment on Re: XS DESTROY not invoked
Download Code
Re^2: XS DESTROY not invoked
by Anonymous Monk on Sep 25, 2012 at 00:45 UTC

    I am not 100% sure why this work

    Neither are we , because we couldn't try this code :)

    Looks like all you did was remove prefix , and use a different package -- that could explain it (being in the wrong package)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995329]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-09-23 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (211 votes), past polls