On Fri, Dec 31, 2004 at 03:23:27PM +0100, Marcus Holland-Moritz wrote: > I'm wondering if someone else ever wanted to do this... > > Deep inside my XS module I create an object and pass it to > a function (which may pass it to other functions and so on). > However, any of these functions may call Perl_croak(), and > if they do, I need to destroy the object if I don't want to > leak memory. Here's an excerpt of the original code:
> Is this the way to do it? I think you could also use SAVEDESTRUCTOR() and SAVEDESTRUCTOR_X() Nicholas Clark