On Wed, Aug 09, 2006 at 11:32:10AM +0200, Marcus Holland-Moritz wrote: > On 2006-08-07, at 19:38:07 +0200, Florian Ragwitz wrote: > > > [...] > > > > Unfortunately DESTROY won't be called when the perl objects reference > > count reaches zero as it seems to be the case in pure-perl world. What's > > the difference between pure-perl code and XS code with regard to > > DESTROY? How can I get my XS DESTROY method called properly? > > There's no difference, I guess there's something just slightly > wrong with your code. Please have a look at the Tie::Hash::Indexed > module on CPAN. It implements a tied hash purely in XS, including > a DESTROY method.
You were right. The problem was that I used newRV_inc() during the construction of the perl object, which resulted in a too high REFCNT. Using newRV_noinc() fixed it. Thanks, Flo -- BOFH excuse #142: new guy cross-connected phone lines with ac power bus.
signature.asc
Description: Digital signature