Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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
Replies are listed 'Oldest First'.
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 lurking in the Monastery: (16)
As of 2015-07-07 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (92 votes), past polls