On Tuesday 08 August 2006 14:21, Florian Ragwitz wrote:
> So you suggest something like this:
>
>   package XSModule;
>
>   use XSLoader;
>   XSLoader::load(__PACKAGE__, $VERSION);
>
>   sub DESTROY { print "Destroying @_\n" }
>
>   1;
>
>
> The destructor doesn't get called this way as well.
Yes I did, and yes it doesn't (next time I'll experiment _before_ offering 
advice :-/ ), but I managed to get it working by also defining a constructor 
in Perl and blessing the pointer returned from XS into the package - in 
retrospect, it makes a lot of sense that the reference must be blessed to 
behave like an object... perldoc perlxs describes how to bless stuff inside 
typemap, but again, perhaps it's easier to do it manually...

        Bye
                Vasek

Reply via email to