Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 :(

Replies are listed 'Best 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?
[ambrus]: YourMother: my brother told me their cat wants to climb into the dishwasher if they leave the door open. Not when the dishwasher is started, but after it's done washing, because it's still warm and cats like warm.
[Your Mother]: Sure, sure. I had a cat as a kid who always slept on top of the fridge because of the heat dissipation up the back.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2017-12-18 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (492 votes). Check out past polls.

    Notices?